-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

>> >May I ask why do you need count queries for ?
>> 
>> e.g. for the statistics dialog. But hsqldb was slow in different areas
>> too, currently I don't remember what areas...but all tests pointed to
>> McKoi.
> 
> Hmm, how often is that thingy called ? can't you store/increase a
> counter each time you insert a new message in the DB insteed of
> recomputing every thing ?

Let me confirm that counts, especially over large tables and for
non-trivial conditions are an "evil thing" and are to be avoided if
performance is an issue, especially in embedded databases which don't
have special count optimizations like grown-up databases have. I've
worked with both hsqldb and Derby, and in some projects I've seen about
100x performance increase when dropping counts and moving to dedicated
counters. Of course, in absence of triggers (and sometimes,
transactions) counters data tends to get out of sync - so they must be
resynchronized from time to time manually. But that's a small price to
pay in this case, IMHO.

Regards,
Victor Denisov.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGB5aolBSxh9pApZoRAjFWAKCmbiduhYdQs/LSrJhKPbS2ee96MgCfSgse
VWv/u6BCCleF4SYIXlpr3fU=
=RC+p
-----END PGP SIGNATURE-----

Reply via email to