Make WordPress Core

Opened 13 years ago

Last modified 5 years ago

#18315 reopened enhancement

Add an index to the GUID column in the posts table

Reported by: alexkingorg's profile alexkingorg Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.2.1
Component: Database Keywords: has-patch dev-feedback early needs-refresh
Focuses: Cc:

Description

Running queries on the GUID column in the posts table is slow because the column is not indexed. The attached patch adds an index.

Note, this affects ticket #18286 - I will update that ticket with appropriate patches to reflect this request.

Attachments (1)

patch.diff (720 bytes) - added by alexkingorg 13 years ago.
Add an index to guid column during upgrade

Download all attachments as: .zip

Change History (16)

@alexkingorg
13 years ago

Add an index to guid column during upgrade

#1 @alexkingorg
13 years ago

  • Keywords has-patch added

#2 @alexkingorg
13 years ago

Ticket #18286 has been updated with a patch that also includes the change suggested here.

#3 @nacin
13 years ago

With the exception of the patch in #18286, there never really should be any queries run against post_guid.

I think to repair #18286, we'll need to do a LIMIT or something. I don't know if it's something we can realistically do for core.

#4 @alexkingorg
13 years ago

Let's chat about this at WCSF. The index costs very little, and I think the use case of using GUIDs to identify posts/pages to be sync'ed between WordPress instances is valid. GUID is perfect for this usage because the value never changes, it is not tied to the site URL, and it can be set as part of wp_insert_post().

#5 @c3mdigital
11 years ago

  • Keywords close added; has-patch removed
  • Resolution set to wontfix
  • Status changed from new to closed

Suggesting close based on Nacin's comments above.

#6 @jeremyfelt
11 years ago

  • Keywords dev-feedback added; close removed
  • Resolution wontfix deleted
  • Status changed from closed to reopened

I'd actually like to hear more reasoning on this before we close it.

I've often wanted to use the guid column as a way to verify uniqueness of content rather than just a placeholder for something that gets put into RSS feeds. Relying on a guid would be much nicer than doing meta queries for some of the stuff I've done in the past.

#7 @SergeyBiryukov
11 years ago

  • Keywords has-patch added

#8 @nacin
11 years ago

Agree with keeping this ticket open.

This ticket was mentioned in IRC in #wordpress-dev by nacin. View the logs.


10 years ago

This ticket was mentioned in IRC in #wordpress-dev by simonwheatley. View the logs.


10 years ago

#11 @SergeyBiryukov
10 years ago

  • Milestone changed from Awaiting Review to 4.0

#12 @DrewAPicture
10 years ago

  • Keywords punt added

Seems like it's probably too late for this.

This ticket was mentioned in IRC in #wordpress-dev by DrewAPicture. View the logs.


10 years ago

#14 @DrewAPicture
10 years ago

  • Keywords punt removed
  • Milestone changed from 4.0 to Future Release

Annnnd no activity since I marked this for punt 3 weeks ago. Punting.

#15 @chriscct7
8 years ago

  • Keywords early needs-refresh added
Note: See TracTickets for help on using tickets.