Make WordPress Core

Opened 12 years ago

Closed 11 years ago

#31268 closed defect (bug) (invalid)

WP_Query die without notice on large result

Reported by: alimuzzamanalim Owned by:
Priority: normal Milestone:
Component: Query Version: 4.1
Severity: normal Keywords: close
Cc: Focuses: performance

Description

My theme is trying to get all of the post in custom post type by WP_Query.
There are about 1400 post. But wp die without showing any error or notice. I have found nothing in error log. I spent a lots of time where is the problem. After applying a lots of trick I have found the theme is trying to get all post. Maybe wp can't handle the query. My post table is 17.7 MiB (33,332 rows) and postmeta table is 157.3 MiB (220,930 rows).

Change History (5)

#1 @dd32
12 years ago

  • Milestone Awaiting Review
  • Resolution → invalid
  • Status new → closed

Long story short: Enable ​WP_DEBUG and you'll probably find PHP is running out of memory with a Fatal error.

WordPress can't really do anything to protect against that case, and themes/plugins should re-consider the need to query everything, or instead retrieve it in chunks for processing.

See also #19866 for discussion over retrieving only certain fields (which we're not going to support).

You can get help for plugin/theme questions through ​the support forums where others can help you with the problem (Since Trac is for a WordPress core bug only)

#2 @alimuzzamanalim
12 years ago

  • Resolution invalid
  • Status closed → reopened

I was enabled the WP_DEBUG but not getting any error. This is why I was posted here. It's die without error.

#3 @SergeyBiryukov
12 years ago

  • Keywords close added
  • Milestone → Awaiting Review

This still seems to be an edge case and a problem with a particular environment.

~180 MB is a lot of data to query at once.

#4 @alimuzzamanalim
12 years ago

The shutdown event is occuring because I found <!-- Performance optimized by W3 Total Cache. at the bottom when use that plugin.

#5 @wonderboymusic
11 years ago

  • Milestone Awaiting Review
  • Resolution → invalid
  • Status reopened → closed

W3 Total Cache uses a DB drop-in, I would visit their support forums to report the issue. Thanks for the report.

Note: See TracTickets for help on using tickets.