pagination

Drupal Performance: Pagination and COUNT queries

Drupal's core pagination system does not scale well on large, high-traffic sites because of it's need to count the total number of items in the list. This involves wrapping the original query around a COUNT query like below.

SELECT COUNT(*) FROM (SELECT nid FROM node);

Count queries are usually very fast for tables using the MyISAM engine, but most high-traffic Drupal sites use the InnoDB engine for most of the tables.