Make WordPress Core

Opened 15 years ago

Closed 15 years ago

#7876 closed defect (bug) (fixed)

post_parent needs an index

Reported by: otto42's profile Otto42 Owned by:
Milestone: 2.7 Priority: normal
Severity: normal Version:
Component: Optimization Keywords:
Focuses: Cc:


Lots of the new functionality related to attachments and galleries and such causes queries which use the post_parent field in the posts table. This field is not indexed, meaning that queries for the images in a gallery cause a lot of DB work to be done. Indexing this field would reduce this work quite a bit, and speed up the creation of gallery displays in posts.

Suggest we add a new index on post_parent to the schema.

Change History (2)

#1 @ShaneF
15 years ago

+1, I noticed that too. $post_parent stopped working with my multiple gallery support so I had to revert to $post_ID and $ID. Though I changed were I needed it, I still think this is a good idea.

#2 @ryan
15 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [9290]) Add post_parent index. fixes #7876

Note: See TracTickets for help on using tickets.