[Lazarus] Postgres database again...

Marc Santhoff M.Santhoff at t-online.de
Wed May 28 14:00:43 CEST 2008


Am Mittwoch, den 28.05.2008, 12:15 +0200 schrieb Graeme Geldenhuys:
> 2008/5/28 Graeme Geldenhuys <graemeg.lists at gmail.com>:
> > 2008/5/28 Bogusław Brandys <brandys at o2.pl>:
> >> "straight GUIDs (e.g. generated by Delphi written application) has their
> >> significant part at the end which does not provide for optimal indexing. Use
> >> of the UDF generating UUID (reverse GUID) is said to improve performance
> >> over the PK dramatically.
> >
> > I'll try and find the code for the 'UDF generating UUID (reverse
> > GUID)' and create a tiOPF OID generator for it.
> 
> Under Linux, it seems FPC gets the kernels UUID when you ask to create
> a GUID via CreateGUID().  Plus the GUID/UUID returned is totally
> random, to parts are the same as the previous request.
> 
> eg;
> 
> graemeg at graemeg:~$ cat /proc/sys/kernel/random/uuid
> ca65c9ce-b097-4ff0-8a1a-7f41628e9982
> graemeg at graemeg:~$ cat /proc/sys/kernel/random/uuid
> c29650af-5562-4669-967d-5227402c0252
> graemeg at graemeg:~$ cat /proc/sys/kernel/random/uuid
> f757c538-70eb-4432-b094-dc3ad5b824f5
> graemeg at graemeg:~$ cat /proc/sys/kernel/random/uuid
> 4a8dca85-2040-4fe5-afa2-dfeb5066c731
> graemeg at graemeg:~$ cat /proc/sys/kernel/random/uuid
> e576429b-fdf9-485a-b9f5-3319a2067b24
> graemeg at graemeg:~$ cat /proc/sys/kernel/random/uuid
> f7335eb4-26bc-4467-8d99-04a3ef8702fd
> 
> 
> So I can't see the point in reversing the returned string.  Maybe
> Delphi or Windows works different and some parts are the same as the
> previous request.

This is where the low-high-scheme may be a good appraoch.

Get the high part from the key server at startup  or when needed because
the lower part space is exhausted once and add a timestamp for the lower
part on every new key. That way the ids are pretty compressable.

Marc





More information about the Lazarus mailing list