Make WordPress Core

Opened 13 years ago

Closed 11 years ago

#18840 closed enhancement (duplicate)

get_pages query optimization for inclusions/exclusions

Reported by: 5ubliminal's profile 5ubliminal Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.3
Component: Performance Keywords: has-patch 3.4-early
Focuses: Cc:


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).

Attachments (1)

get_pages_inexclusions_sql_optimisation.patch (1.3 KB) - added by 5ubliminal 13 years ago.

Download all attachments as: .zip

Change History (3)

#1 @nacin
13 years ago

  • Keywords has-patch 3.4-early added
  • Milestone changed from Awaiting Review to Future Release
  • Type changed from task (blessed) to enhancement

Looks good. We probably have a few other areas in core that results in similar SQL construction as well.

#2 @wonderboymusic
11 years ago

  • Milestone Future Release deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #22074.

My patch is newer, does the same-ish thing

Note: See TracTickets for help on using tickets.