- Path Patch #1213242 by andypost: optimize count(has) quiery.

8.0.x
Dries Buytaert 2011-08-26 10:01:17 +01:00
parent 1866b96eaa
commit a8d2c8e862
1 changed files with 1 additions and 1 deletions

View File

@ -283,7 +283,7 @@ function _aggregator_category_title($category) {
* otherwise.
*/
function _aggregator_has_categories() {
return user_access('access news feeds') && db_query('SELECT COUNT(*) FROM {aggregator_category}')->fetchField();
return user_access('access news feeds') && (bool) db_query_range('SELECT 1 FROM {aggregator_category}', 0, 1)->fetchField();
}
/**