Custom types, taxonomies and query optimization

I’m doing a re-design and re-coding of a fairly large WordPress website. As part of it we’re adding some different post types representing various data types (website will have additional data-driven pages for viewing). I’m trying to do some work to optimize the way I set up the various meta data and taxonomies in order to ensure good performance long term when we have lots of data.

Let’s say I have the following post types:

  1. Articles (Posts)
  2. Events
  3. People

I have some sort of custom field or taxonomy: Team

Team will have roughly 15 options for its value. Every Article and every Event will be assigned to one team. The team options will be the same for articles, events and people.

Should team be a taxonomy? If so, am I essentially setting up a duplicate taxonomy for each post type (one for articles and one for events and one for people)?

I will definitely be querying based on the team value for all 3 post types, so I’m assuming meta data isn’t ideal since the meta value is not indexed in the database. Is it a bad idea to add an index for the meta value column in that DB table?

Read more here: Custom types, taxonomies and query optimization

Leave a Reply

Your email address will not be published. Required fields are marked *