[Lazarus] Postgres database again...

Bogusław Brandys brandys at o2.pl
Wed May 28 10:32:21 CEST 2008


Graeme Geldenhuys wrote:
> Joao Morais wrote:
>>>> nightmare. Knowing you have a guaranteed unique ID from the start is a 
>>>> big plus.
>> Why? Btw you don't need to know the ID before store the objects since 
>> you are using a persistence framework.
> 
> As I said in a previous post, our business objects don't reference each 
> other via there OID, so no it's not important for me. And yes the OPF 
> frameworks takes care of the nitty gritty stuff.
> 
> For those not using the tools I use, might not be so luck. In example... 
> Using the standard DB components in Delphi or Lazarus and using 
> Master/Details grids and tables, you need to save the master record 
> first, find out the unique identifier of the master record, include that 
> in the SQL for the detail records.
> 
> In the this example you need a extra round trip to the database if your 
> application can't generate a unique identifier itself. GUID's make this 
> a no brainer. :)
> 
> 
> Regards,
>    - Graeme -
> 


Graeme,

I'd like to point your attention to the fact mentioned long time ago on 
Firebird list by Ann Harrison:

"As you are transforming your GUID, try to keep the least volatile bytes at
the front and the most volatile at the end.  Firebird uses prefix
compression in its indexes and the saving in space on the index pages
absolutely will improve performance on all but the most trivial data sets.

Ann"

Simply using GUID's in VARCHAR or CHAR column slowdown queries much 
after 4 millions of rows approached due to ineffectively used indexes.


Regards
Boguslaw

> _______________________________________________________
> fpGUI - a cross-platform GUI toolkit using Free Pascal
> http://opensoft.homeip.net/fpgui/
> 
> 
> _______________________________________________
> Lazarus mailing list
> Lazarus at lazarus.freepascal.org
> http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
> 




More information about the Lazarus mailing list