First of all, anything that involves LIKE
just can’t be fast. If you want fast queries, avoid LIKE
.
On top of that, basically your combined query just don’t care if there is a repeat or not, so just one variation without checking the repeat field should be enough.
Now why does the server crash is hard to tell, but most of the time it is a symptom of running out of memory. The question here is whether it is the mySQL that ran out of memory or the PHP side. In any case, requesting an unbound number of results will do that to you when you have many results.
Related Posts:
- Getting attachments by meta value
- WordPress altering my custom query, How to fix it?
- How to make Meta Query case sensitive?
- Fetch Record based on meta key dates
- how to make members list directory through wordpress post custom meta key.
- How do i create a custom post query when the meta value is an array?
- Trouble with serialized metadata
- Query against multiple locations within single custom post type post
- Can wp_query return posts meta in a single request?
- Use REGEXP in WP_Query meta_query key
- Meta query with string starting like pattern
- compare meta_query in get_posts arguments
- meta_query where value is equal to given value
- querying with custom meta field with meta_query
- Order by meta_value_num DESC and meta_value ASC on WP 4.0
- What is an efficient way to query based on post_meta?
- WP_Query not working as expected for attachments and custom meta_query
- How can I create a WP_Query that returns posts where one meta_value
- WP Meta Query for some meta (array) values
- Querying by taxonomy vs Querying by Custom fields Speed Comparison
- How to get sum of meta_values of a meta_key in wp_query according to conditions
- Order by meta_key in custom post type doesn’t affect the query
- meta_key and meta_value not working together
- Order posts by meta value and Date
- Order Posts by meta value AND published date
- Get meta info related to current post
- Group WP_Query by meta_key date
- exclude posts with a specific custom field and value
- Performance when getting post meta for post retrieved by meta value
- Get attachment by meta_key value
- Display custom field meta outside loop, site wide
- Meta_query with multiple keys and multiple values
- meta_query BETWEEN, but the range is stored in the custom field
- Extend product search with meta in WooCommerce
- meta_value_num not ordering all items
- meta_compare not comparing whole integer
- Is it possible to retrieve all posts with a certain value for metadata?
- Filter posts by comparing custom meta value against postdate
- Display posts with specific value first in query
- Get every post with value in meta key
- Order WP_Query results by meta key value in custom query
- Nested array issue in meta_query
- Display post meta conditionally based on it’s value
- add_query_arg to compare and display events from a certain date
- Comparing 2 Decimal Numbers from custom fields and displaying posts
- Query posts by searching for a string in a meta field
- WP_Query meta compare must include ALL array values
- meta_query weird behaviour, static int will work, but not user data
- Query multiple post types, but different order for each
- Order by the first array within a meta_query
- Query ACF relationship field – Comparator IN – Value array
- ACF: How to query for a given value count of an array like field? (e.g.: How many rows has a `flexible_content` field?)
- How to _GET multiple value checkbox WP_Query in Custom Toxonomy / Custom Fields
- wp query to use both author id and meta_query
- WP Query – grouping posts by same meta key, adding together values from another key
- Meta query ignores multiple values of the key
- meta_query is overriding default search
- show most viewed post
- Comparing Meta Field date in WPQuery using Meta_Query?
- Why can my filter query SOME metadata but not other metadata?
- Getting posts by custom field value
- WP_Query, ACF field and array
- How to set meta_query if get_post_meta returns nested array for that key? [duplicate]
- Order by Date Custom Field
- Query by meta value (add a dropdown of all values)
- Order Posts By Custom Field That is an array of objects
- Saving custom fields for WP_Query to retrieve
- Meta key in wp_query bug?
- Custom WP_query and integrating into theme file
- How to show all the associated posts with specific date of data metabox?
- WP Meta Query at depth 2
- Using custom field as ‘orderby’ value causing post grouping by publish date
- WP_Query Posts by Metadata from Option Tree
- Compare meta key separation
- Sorting Posts with meta value not working
- Return a single custom post from multiple meta queries
- Custom Search Query – include only custom fields and title
- query post based on comparison
- Querying meta values within an array
- Get posts by meta value except one post [closed]
- WP_Query by meta key not returning any posts
- Extend search query to search meta keys values based on search string
- How to only display posts whose meta_value field is not empty?
- WP_Query min and max values
- WP-CLI How to generate a list of posts with corresponding meta values
- query posts in functions.php and update a field
- pre_get_posts filter meta_query without conflicting existing meta_query
- Minimising Database Queries when using Advanced Custom Fields
- Adding an array from a query string to a WP meta_query
- Query multiple meta values
- Query posts without meta preload
- echo a specific meta_key queried through a custom post
- WP_Query with meta_query dosen’t return results
- How to add a “base” filter for all posts visible to visitors on the site?
- WP_User_Query Orderby Not Working
- Unusual high query of user meta data
- WordPress Query optimaization for slow query
- WP_Query using meta_query with LIKE doesn’t return what it should
- new WP_query using custom fields
- Use value from meta key array for use in WP_Query