Skip to content
Read For Learn
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP

Large AND OR query timing out

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:

  1. Getting attachments by meta value
  2. WordPress altering my custom query, How to fix it?
  3. How to make Meta Query case sensitive?
  4. Fetch Record based on meta key dates
  5. how to make members list directory through wordpress post custom meta key.
  6. How do i create a custom post query when the meta value is an array?
  7. Trouble with serialized metadata
  8. Query against multiple locations within single custom post type post
  9. Can wp_query return posts meta in a single request?
  10. Use REGEXP in WP_Query meta_query key
  11. Meta query with string starting like pattern
  12. compare meta_query in get_posts arguments
  13. meta_query where value is equal to given value
  14. querying with custom meta field with meta_query
  15. Order by meta_value_num DESC and meta_value ASC on WP 4.0
  16. What is an efficient way to query based on post_meta?
  17. WP_Query not working as expected for attachments and custom meta_query
  18. How can I create a WP_Query that returns posts where one meta_value
  19. WP Meta Query for some meta (array) values
  20. Querying by taxonomy vs Querying by Custom fields Speed Comparison
  21. How to get sum of meta_values of a meta_key in wp_query according to conditions
  22. Order by meta_key in custom post type doesn’t affect the query
  23. meta_key and meta_value not working together
  24. Order posts by meta value and Date
  25. Order Posts by meta value AND published date
  26. Get meta info related to current post
  27. Group WP_Query by meta_key date
  28. exclude posts with a specific custom field and value
  29. Performance when getting post meta for post retrieved by meta value
  30. Get attachment by meta_key value
  31. Display custom field meta outside loop, site wide
  32. Meta_query with multiple keys and multiple values
  33. meta_query BETWEEN, but the range is stored in the custom field
  34. Extend product search with meta in WooCommerce
  35. meta_value_num not ordering all items
  36. meta_compare not comparing whole integer
  37. Is it possible to retrieve all posts with a certain value for metadata?
  38. Filter posts by comparing custom meta value against postdate
  39. Display posts with specific value first in query
  40. Get every post with value in meta key
  41. Order WP_Query results by meta key value in custom query
  42. Nested array issue in meta_query
  43. Display post meta conditionally based on it’s value
  44. add_query_arg to compare and display events from a certain date
  45. Comparing 2 Decimal Numbers from custom fields and displaying posts
  46. Query posts by searching for a string in a meta field
  47. WP_Query meta compare must include ALL array values
  48. meta_query weird behaviour, static int will work, but not user data
  49. Query multiple post types, but different order for each
  50. Order by the first array within a meta_query
  51. Query ACF relationship field – Comparator IN – Value array
  52. ACF: How to query for a given value count of an array like field? (e.g.: How many rows has a `flexible_content` field?)
  53. How to _GET multiple value checkbox WP_Query in Custom Toxonomy / Custom Fields
  54. wp query to use both author id and meta_query
  55. WP Query – grouping posts by same meta key, adding together values from another key
  56. Meta query ignores multiple values of the key
  57. meta_query is overriding default search
  58. show most viewed post
  59. Comparing Meta Field date in WPQuery using Meta_Query?
  60. Why can my filter query SOME metadata but not other metadata?
  61. Getting posts by custom field value
  62. WP_Query, ACF field and array
  63. How to set meta_query if get_post_meta returns nested array for that key? [duplicate]
  64. Order by Date Custom Field
  65. Query by meta value (add a dropdown of all values)
  66. Order Posts By Custom Field That is an array of objects
  67. Saving custom fields for WP_Query to retrieve
  68. Meta key in wp_query bug?
  69. Custom WP_query and integrating into theme file
  70. How to show all the associated posts with specific date of data metabox?
  71. WP Meta Query at depth 2
  72. Using custom field as ‘orderby’ value causing post grouping by publish date
  73. WP_Query Posts by Metadata from Option Tree
  74. Compare meta key separation
  75. Sorting Posts with meta value not working
  76. Return a single custom post from multiple meta queries
  77. Custom Search Query – include only custom fields and title
  78. query post based on comparison
  79. Querying meta values within an array
  80. Get posts by meta value except one post [closed]
  81. WP_Query by meta key not returning any posts
  82. Extend search query to search meta keys values based on search string
  83. How to get products with the same custom attribute like ean code
  84. Add indexing to meta_value in wp_postmeta
  85. Custom WP_Query order by post_meta and (author) user_meta
  86. How Can I save multiple records in same meta key?
  87. Trying to perform complex custom field query with order by set to field value
  88. Sorting Posts by custom field
  89. Order posts by date and then by custom field
  90. Compare two meta-fields in a wp_query (where meta-field-A is larger than meta-field-B)
  91. Meta Query querrying several post types based on ACF fields is broken after update to WP 4.1
  92. Difference between ‘LIKE’ and ‘IN’ in meta queries
  93. Order WP Query posts by custom order calculated from post meta values
  94. How to query for custom field within Gutenberg block from outside of that post? [closed]
  95. Meta query with JSON value
  96. Creating arguments from loop for WP_Query meta_query
  97. Select from wp_post and multiple meta_value from wp_postmeta
  98. Using meta_query with multiple keys and compare values
  99. Is it possible to set specific posts to show first in a query?
  100. Orderby listing issue
Categories wp-query Tags custom-field, meta-query, post-meta, wp-query
Compare old meta with new post meta
Using paginate_links() to generate “01, 02, 03, 04” paginations

Recommended Hostings

Cloudways: Realize Your Website's Potential With Flexible & Affordable Hosting. 24/7/365 Support, Managed Security, Automated Backups, and 24/7 Real-time Monitoring.

FastComet: Fast SSD Hosting, Free Migration, Hack-Free Security, 24/7 Super Fast Support, 45 Day Money Back Guarantee.

Recent Added Topics

  • Bug in translation system: load_theme_textdomain() returns true, files are available and accessible but the language defaults to english
  • Custom Elementor controls not appearing in the widget Advanced tab using injection hooks
  • Get the name of the template/*html file used
  • Trying to Add Paging to Single Post Page
  • Sharing media files between live and staging servers
  • How to display the description of a custom post type in the dashboard?
  • Critical error on image display
  • Copying WP data and files into new install?
  • How to determine the DirectAdmin WordPress backup date?
  • How to get list of ALL tables in the database?
© 2026 Read For Learn
  • Database
    • Oracle
    • SQL
  • algorithm
  • asp.net
  • assembly
  • binary
  • c#
  • Git
  • hex
  • HTML
  • iOS
  • language angnostic
  • math
  • matlab
  • Tips & Trick
  • Tools
  • windows
  • C
  • C++
  • Java
  • javascript
  • Python
  • R
  • Java Script
  • jQuery
  • PHP
  • WordPress