Make WordPress Core

Opened 18 years ago

Closed 18 years ago

#3347 closed defect (bug) (fixed)

Changeset 4455 - SELECT FOUND_ROWS() faster than count()?

Reported by: alexkingorg's profile alexkingorg Owned by: ryan's profile ryan
Milestone: 2.1 Priority: normal
Severity: normal Version: 2.1
Component: General Keywords:
Focuses: Cc:

Description

This change looks like it resolves ticket 3274 in a different way than the patch. I'm wondering if an additional query is faster/slower than counting the array we already have as a PHP variable.

http://trac.wordpress.org/ticket/3274

Change History (3)

#1 @ryan
18 years ago

In my testing, SELECT FOUND_ROWS() is extremely fast, and adding SQL_CALC_FOUND_ROWS to the post query has minimal overhead. Overall, it's faster for me than doing another SELECT FROM. What are your impressions so far?

#2 @markjaquith
18 years ago

Austin Matzko on wp-hackers notes that SQL_CALC_FOUND_ROWS requires MySQL 4.0, while WordPress up 'til now has worked on MySQL 3.23.23

Just as FYI. I'm fine leaving MySQL 3 in the dust. Matt may feel differently.

#3 @ryan
18 years ago

  • Resolution set to fixed
  • Status changed from new to closed

We're going to bump the MySQL requirement for 2.1.

So far this is proving useful on wordpress.com. I'll resolve as fixed.

Note: See TracTickets for help on using tickets.