Make WordPress Core

Opened 14 years ago

Closed 13 years ago

#24245 closed enhancement (fixed)

Convert category__and query into category__in when only one category passed in

Reported by: batmoo Owned by: wonderboymusic
Priority: normal Milestone: 3.7
Component: Query Version:
Severity: normal Keywords: has-patch
Cc: Focuses:

Description

If a category__and query gets only one term passed in, it still builds out the complex query required for the AND lookup, which can be pretty expensive (#16706).

We should be smarter and automatically convert the query into a category__in when category__and only gets passed in one category.

Attachments (2)

24245.diff​ (1.7 KB ) - added by wonderboymusic 13 years ago.
24245.2.diff​ (3.3 KB ) - added by wonderboymusic 13 years ago.

Download all attachments as: .zip

Change History (4)

#1 @wonderboymusic
13 years ago

  • Keywords has-patch added
  • Milestone Awaiting Review → 3.7

Mo, take a look and see if this patch accomplishes what you want, I think it does

#2 @wonderboymusic
13 years ago

  • Owner set to wonderboymusic
  • Resolution → fixed
  • Status new → closed

In 25238:

Convert category__and to category__in (less expensive) and unset it when only one category is passed. Adds unit tests.

Fixes #24245.

Note: See TracTickets for help on using tickets.