[wp-trac] [WordPress Trac] #18840: get_pages query optimization for inclusions/exclusions

WordPress Trac wp-trac at lists.automattic.com
Sun Oct 2 08:28:33 UTC 2011


#18840: get_pages query optimization for inclusions/exclusions
----------------------------+-----------------------------
 Reporter:  5ubliminal      |      Owner:
     Type:  task (blessed)  |     Status:  new
 Priority:  normal          |  Milestone:  Awaiting Review
Component:  Performance     |    Version:  3.3
 Severity:  normal          |   Keywords:
----------------------------+-----------------------------
 Turned '''ID <> 1, ID <> 2, ...''' into '''ID IN (1, 2, ...)'''.
 Removed some '''redundant ->prepare''' as the IDs are already int-cast,
 hence improved performance.

 Concatenation is done once also, not once for each excluded ID.
 Shortened the query a lot and gained 20% in speed compared to old method
 ''(on about 25 excluded pages from about 40)''.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/18840>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list