scribu / wp-posts-to-posts

Efficient many-to-many connections between posts, pages, custom post types, users.
http://wordpress.org/plugins/posts-to-posts/
973 stars 260 forks source link

Compound indexes #263

Open scribu opened 11 years ago

scribu commented 11 years ago

Instead of having an index on just the p2p_type column, we could potentially get better performance by having two compound indexes:

(p2p_type, p2p_from)
(p2p_type, p2p_to)

http://wordpress.org/support/topic/plugin-posts-2-posts-use-of-compound-indexes

judgej commented 11 years ago

On my 15,000 linked posts, doing this shaves very approximately about 5mS off a 40mS query. With more connection types, it could improve things more.

The 40mS query gets the track listings here, for example:

http://www.soulbrother.com/shop/newbannewban-2/