On Freitag 03 April 2009 Wallace Tan wrote:
> select count(1) from t1;

That would have been my next question. I've spoken once to Paul, because 
dbmail uses lots of count(*), but PostgreSQL optimizes this out. Now it 
seems MySQL would have a performance boost using count(1).

Could you please try:
1) first, SELECT COUNT(1) FROM dbmail_messageblks;
and afterwards
2) SELECT COUNT(*) FROM dbmail_messageblks;

The order is important: After the first select(), the table will be 
cached, so the 2nd query will be faster. That, BTW, is part of the 
explanation why your 2nd query was much faster than the 1st.
Still, count(1) should be faster than count(*) I would expect from the 
thread you posted. I do not have a MySQL db with enough data to test 
around. We're using PostgreSQL because things like that happen to exist 
in MySQL since years, and I don't need a DBMS where I have to think for 
it. I wonder why the devs don't manage to work around those problems. 
But no flames please, everybody should use what they prefer.

mfg zmi
-- 
// Michael Monnerie, Ing.BSc    -----      http://it-management.at
// Tel: 0660 / 415 65 31                      .network.your.ideas.
// PGP Key:         "curl -s http://zmi.at/zmi.asc | gpg --import"
// Fingerprint: AC19 F9D5 36ED CD8A EF38  500E CE14 91F7 1C12 09B4
// Keyserver: wwwkeys.eu.pgp.net                  Key-ID: 1C1209B4

_______________________________________________
DBmail mailing list
DBmail@dbmail.org
http://mailman.fastxs.nl/cgi-bin/mailman/listinfo/dbmail

Reply via email to