I’m writing a plugin and the following query keeps exhausting my memory ONLY when the query should return no results:
(The two variables are totally fine numeric timestamps.)
$query_args = array( 'post_type' => 'cets_event', 'order' => 'ASC', 'orderby' => 'meta_value_num', 'meta_key' => '_ez_start_date', 'meta_query' => array ( array( 'key' => '_ez_start_date', 'value' => $ts_start_of_month, 'compare' => '>', ), array( 'key' => '_ez_start_date', 'value' => $ts_end_of_month, 'compare' => '<', ), ) ); $event_query = new WP_Query( $query_args );
As you can probably guess, it grabs all the events from a given month. It works just fine on any month that has any events created for it, but keeps running out of memory otherwise.
It _really_ shouldn’t be any kind of actual memory issue, as I have 128M available and have not run into a single memory issue before ever.
The memory runs out from /wp-includes/query.php on line 2941 (the call to get_posts)
- The topic ‘WP_Query Memory problem only on Result-less Queries’ is closed to new replies.