[Lazarus] Postgres database again...

Damien Gerard milipili at shikami.org
Tue May 27 15:01:46 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...
>

Your problems a real. However I don't think it is the better way to do  
it.
Your app should not never be dependant of Primary keys.
Finding the good id should be the work of you DB and not your app.

I agree others DB than postgres have not all required features but  
they have their own one.

It is not really a problem of disk usage (even if I disagree here :  
INT4/INT8 vs CHAR(36) * RowCount ...) but when you have huge data  
databases, milliseconds are (very) important and you can not afford to  
use indexes on varchar/char (whatever the DB is)


--
Damien Gerard
milipili at shikami.org

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









More information about the Lazarus mailing list