See #196862: COUNT(*) is an expensive query in InnoDB..

There are three COUNT queries in CCK that are simple checks on whether "Stuff Exists". Best practice for a check like that is to use a query in the following form:

db_result(db_query_range("SELECT 1 ...", 0, 1));
CommentFileSizeAuthor
cck.sql_count_bad.patch1.83 KBGrayside
Support from Acquia helps fund testing for Drupal Acquia logo