Post Meta Abuse


Post meta queries bring down databases, cripple traffic scaling, and dramatically inflate page load times. Thankfully there’s an almost trivial solution. Searching for Meta
The problem comes when you need to query for post meta. This is a data design failure. Examples include:
A meta key for posts that should appear on the homepage
Marking a post as belonging to another post to be shown in a list
Bundling posts together into threads
Setting a type, such as the type of fabric of a post of type t-shirt
Setting an items colour
These are all examples of post meta that we want to search for. We might want to show only the red items, or the t-shirts made of cotton. These sound reasonable, but the query to find those posts with that meta can have monstrous performance costs.
If post meta was built to be searched, we’d be using it to store categories and tags.
Isn’t this just good/bad practice pedantry?
No, sites have been brought down by this, and it’s the reason a number of popular plugins don’t scale to high traffic. Install Query Monitor on a slow site, and you’ll see these queries. Page builders and meta box frameworks are particularly prone to enabling
Source: https://managewp.org/articles/13960/post-meta-abuse




source https://williechiu40.wordpress.com/2016/12/06/post-meta-abuse/