Timeline for Tax query clause inside a meta query clause?
Current License: CC BY-SA 4.0
7 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jun 24, 2020 at 7:08 | vote | accept | superfive33 | ||
Jun 23, 2020 at 17:41 | answer | added | Tom J Nowell♦ | timeline score: 1 | |
Jun 23, 2020 at 17:27 | comment | added | Tom J Nowell♦ | Otherwise what you want to do in this Q will require complex SQL, multiple queries, and will have a big performance impact, resulting in a very slow multi-second query, and a significant reduction in the number of concurrent visitors your site can handle | |
Jun 23, 2020 at 17:26 | comment | added | Tom J Nowell♦ |
I disagree as you're searching and filtering for posts via their values. As a reviewer of millions of lines of enterprise level code running billions of page views, I've seen cheaper queries bring down much more powerful servers. Use a private taxonomy and give posts either show_is_creation or show_is_not_creation . This allows you to make huge performance gains, and makes your queries much simpler to write. Note I'm not advising you make seperate custom taxonomies for each and every value, you only need a single taxonomy then individual terms.
|
|
Jun 23, 2020 at 12:19 | comment | added | superfive33 |
show_is_creation is just a boolean flag. IMO this should not be a taxonomy.
|
|
Jun 23, 2020 at 10:32 | comment | added | Tom J Nowell♦ |
That would be an extremely heavy slow and expensive query to run. show_is_creation and other tags should be stored as a custom taxonomy, which would make your question significantly easier to answer, and the query possibly hundreds of times quicker. Otherwise what you're asking for is going to be very difficult to do, and very heavy on the database server. Likewise with your season value, it should be a custom taxonomy named season . If you ever need to sort/filter posts by something, store the data you're filtering by in a custom taxonomy not post meta
|
|
Jun 23, 2020 at 10:27 | history | asked | superfive33 | CC BY-SA 4.0 |