Closed (won't fix)
Project:
Drupal core
Version:
7.x-dev
Component:
database system
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
31 Dec 2010 at 18:30 UTC
Updated:
4 Jan 2011 at 01:05 UTC
Jump to comment: Most recent file
Comments
Comment #1
agentrickardAnd a patch. The logic here is that if the COUNT query matches the syntax of the base query, then query caching kicks in for a nice win.
Comment #2
agentrickardTestbot fail.
Comment #3
agentrickardForce testbot.
Comment #4
agentrickardAnd again.
Comment #5
agentrickardBad testbot crash.
Comment #7
Stevel commentedLooks like we need the field to stay also if an alias to the field/expression is in the group by clause.
Comment #8
agentrickardThat didn't make any sense.
Comment #9
Stevel commentedSure it does:
SELECT Count(*), field_name as field_name_alias FROM test_table GROUP BY field_name_aliasComment #10
damien tournoud commentedThe premise of this bug report is false:
That's not true in any version of MySQL. We studied that at length in #423888: Use subqueries for ->countQuery(), at least for MySQL.
Comment #11
damien tournoud commentedAlso see a long discussion in #778050: Add support for database hints and make PagerDefault properly pluggeable why we haven't followed the SQL_CALC_FOUND_ROWS route in Drupal 7 (or why one query + one count query that never changes can be better then only one more costly query).