[wp-trac] [WordPress Trac] #14426: unneeded "SELECT FOUND_ROWS()" when no posts are found
WordPress Trac
wp-trac at lists.automattic.com
Sun Sep 16 16:32:03 UTC 2012
#14426: unneeded "SELECT FOUND_ROWS()" when no posts are found
-------------------------+-----------------------
Reporter: mark-k | Owner:
Type: enhancement | Status: reopened
Priority: normal | Milestone: 3.5
Component: Query | Version: 3.0
Severity: normal | Resolution:
Keywords: has-patch |
-------------------------+-----------------------
Comment (by nacin):
> $found_posts description seems inaccurate
Yes, it is. It is meant to only be set when limits are *are* used.
However, we should also set it when limits are *not* used, since it would
be equal to post_count in this case.
We should also be able to avoid a FOUND ROWS query when the post_count is
less than what the limit requested, but that's a bit more difficult as you
also have to ensure there was no offset or paging in effect.
[attachment:14426.3.patch] looks good. Do we agree?
--
Ticket URL: <http://core.trac.wordpress.org/ticket/14426#comment:14>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list