=== On 2004-04-09, D. Richard Hipp wrote ===
..
>
>The reason for not doing this is that maintenance of the counter
>slows down inserts and deletes.  Is having a constant-time count(*)
>really work slower inserts and deletes?  If you have opinions on
>this, speak up now, because it won't be an option later.
>

I have no idea of the complexities internal to SQLite (I'm just sure it is complex ;),
but its a variable that only needs update on inserts and deletes, when the
database is locked for writing. It will add a file page page that needs to be updated
to disk, but as it will always be the same page would not that be negligible compared
with the time needed for parsing and writing the others expressions? As it is the
same page it will always be possible for the OS to cache it.

The typical use of the COUNT(*) expression is when displaying results in a grid. One
needs to know how many rows are so it can use the LIMIT expression later to just fetch
a page at a time (and to know in advance the number of pages). If we use a trigger to
emulate this row count I'm sure the penalty for insertion/deletion would be much worse.

I have full confidence on your work, so what you decide is enough for me.

Regards,
~Nuno Lucas

P.S.- Everytime I post something I receive two copies of the message I posted and
a warning message for every recipient in the list that isn't available anymore. Could
someone please check it out? Thanx.




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to