Make WordPress Core

Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#23459 closed enhancement (duplicate)

Huge number of excluded IDs in get_pages dramatically slows down the site

Reported by: mikelopez's profile mikelopez Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Performance Keywords:
Focuses: Cc:



Just noticed that my site slows down dramatically if a huge number of IDs are passed for exclusion to get_pages.

Site slow down are tracked down to a foreach loop and a mysql query that uses multiple AND ID <> xx instead of ID NOT IN () which is better for performance.

Attached is a patch to fix improve this part of the code and also speeds up the site.

Thanks for considering my first contribution.


Attachments (1)

post.diff (1.2 KB) - added by mikelopez 11 years ago.
Patch file

Download all attachments as: .zip

Change History (3)

#1 @SergeyBiryukov
11 years ago

  • Component changed from General to Performance
  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed
  • Version trunk deleted

Duplicate of #22074.

11 years ago

Patch file

#2 @mikelopez
11 years ago

Just worth noting that even if the resulting query is still long, it's a lot faster.

Note: See TracTickets for help on using tickets.