[Lazarus] Postgres database again...

Damien Gerard milipili at shikami.org
Tue May 27 14:28:10 CEST 2008


Le May 27, 2008 à 2:14 PM, Graeme Geldenhuys a écrit :

> Michael Van Canneyt wrote:
>>> Cons:
>>>  * Yes it's longer than an Integer type and uses more space, but  
>>> with
>>> today's hard drive sizes that is totally irrelevant.
>>
>> The size on disk is not relevant, but the size in memory is. Speed  
>> is an
>> issue, and the smaller the data is, the more can be kept in memory,  
>> and the
>> faster the engine can traverse it when doing queries.
>>
>> It's the very reason why I don't use GUIDs as primary keys.
>>
>> If you have a busy server, 8 CPU's, lots of memory, but 500  
>> simultaneous
>> connections, such seemingly unimportant details all of a sudden do  
>> become
>> important.
>
> Memory is cheap too!  :)
>
> The pros still outweigh the cons.
>
> * Guaranteed uniqueness, so we can easily merged different franchisees
> databases into one master database for statistics generation.
> * No extra round trips to the DB Server (which could be over a slow
> connection on a remote site)
> * DB Server independent
> * Really easy to implement and guaranteed to work.
>   - MS SQL Server's @@identify prone to errors
>   - Firebird/Interface triggers don't return identity value like
>     Postgress
>   - Batch ID retrieval (say 20 at a time) in combination with
>     Amblers High/Low algorithm waists numbers. But saves on DB round
>     trips.
> etc...


Anyway, with experience, you can not make code 100% database  
independant.
Each database has its features, strong and weak parts and you can not  
design the same DB structure in an efficient way




--
Damien Gerard
milipili at shikami.org

"Intelligence is 10 million rules."
    -- Douglas Lenat









More information about the Lazarus mailing list