WordPress.org

Make WordPress Core

Opened 7 years ago

Closed 7 years ago

#3900 closed enhancement (fixed)

New keys for post2cat

Reported by: Xmion Owned by: rob1n
Milestone: 2.3 Priority: normal
Severity: normal Version:
Component: Optimization Keywords: has-patch
Focuses: Cc:

Description

Have you guys seen this, is this something that can improve somewere on wordpress as it does on Lyceum look over at this url, damn hot for lyceum anyway. http://source.ibiblio.org/trac/lyceum/changeset/1012

Attachments (1)

unique_key.diff (1.3 KB) - added by ryan 7 years ago.

Download all attachments as: .zip

Change History (11)

comment:1 foolswisdom7 years ago

  • Milestone changed from 2.1.3 to 2.2

ryan7 years ago

comment:2 ryan7 years ago

Looks like we need to change dbDelta to handle the upgrade.

WordPress database error: [Duplicate key name 'link_id']
ALTER TABLE wp_link2cat ADD UNIQUE link_id (link_id,category_id)


WordPress database error: [Duplicate key name 'post_id']
ALTER TABLE wp_post2cat ADD UNIQUE post_id (post_id,category_id)

comment:3 ryan7 years ago

  • Summary changed from Performance of the site to New keys for post2cat

comment:4 rob1n7 years ago

Unless I'm misunderstanding something, wouldn't that force post_id or category_id to be unique? What if a post has more than one category assigned to it, and thus more than one entry in post2cat with the same post_id's?

I'm not great with SQL, so there's probably something I'm missing...

comment:5 ryan7 years ago

The pair has to be unique, so a post can't have the same category more than once in the post2cat table, which would be pointless anyway.

comment:6 rob1n7 years ago

  • Keywords has-patch commit added; Performance removed

Ah. +1 then. Anybody interested in benchmarking the differences?

comment:7 rob1n7 years ago

  • Keywords commit removed
  • Owner changed from anonymous to rob1n
  • Status changed from new to assigned

Working on dbDelta stuff.

comment:8 rob1n7 years ago

  • Milestone changed from 2.2 to 2.3

comment:9 rob1n7 years ago

  • Status changed from assigned to new

comment:10 ryan7 years ago

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

post2cat is gone in 2.3.

Note: See TracTickets for help on using tickets.