Title: PHP Warning: Killed Query
Last modified: September 29, 2023

---

# PHP Warning: Killed Query

 *  Resolved [nickiova](https://wordpress.org/support/users/nickiova/)
 * (@nickiova)
 * [2 years, 8 months ago](https://wordpress.org/support/topic/php-warning-killed-query/)
 * Hi There,
 * We are getting the following warning in our server error logs regarding the plugin:
 *     ```wp-block-code
       KILLED QUERY (60093 characters long generated in /wp-content/plugins/custom-order-numbers-for-woocommerce/includes/class-alg-wc-custom-order-numbers-core.php:262): SELECT post_id, meta_key, meta_value FROM wp_postmeta WHERE post_id IN ([order numbers listed]...
       ```
   
 * It seems the Query is listing all the original order numbers and due to the volume
   of orders being placed, it is exceeding the current limit.
 * We have noticed slow down in the wp-admin area more recently as I’m assuming 
   the more order that are place, the bigger toll it is taking? We also previously
   reported a conflict with our server’s (WP Engine) Object Caching system which
   had to be disabled – again, assuming because of the number of orders being placed.
 * Is there anything that can be adjusted to resolve some of these issues?

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Plugin Author [tychesoftwares](https://wordpress.org/support/users/tychesoftwares/)
 * (@tychesoftwares)
 * [2 years, 8 months ago](https://wordpress.org/support/topic/php-warning-killed-query/#post-17102424)
 * Hi [@nickiova](https://wordpress.org/support/users/nickiova/),
   Yes, it seems 
   the error you’re encountering appears to be related to a long-running database
   query to fetch a large number of orders. We will be working on this and will 
   provide you the fix for the same.In the meantime, can you tell me how many orders
   do you have on your site?
 *  Thread Starter [nickiova](https://wordpress.org/support/users/nickiova/)
 * (@nickiova)
 * [2 years, 8 months ago](https://wordpress.org/support/topic/php-warning-killed-query/#post-17111217)
 * Hi [@tychesoftwares](https://wordpress.org/support/users/tychesoftwares/) ,
 * Thanks for your response. There’s currently over 20,000 orders on the website
   as of now.
 * Let me know if I can provide any further information.
 * Thanks.
    -  This reply was modified 2 years, 8 months ago by [nickiova](https://wordpress.org/support/users/nickiova/).
 *  Plugin Author [tychesoftwares](https://wordpress.org/support/users/tychesoftwares/)
 * (@tychesoftwares)
 * [2 years, 8 months ago](https://wordpress.org/support/topic/php-warning-killed-query/#post-17125848)
 * Hi [@nickiova](https://wordpress.org/support/users/nickiova/),
 * We have the issue fixed & I am sending you a patch file to address this issue.
    1. You can download the code patch from this link – [https://www.dropbox.com/scl/fi/ocwbxztsv5ffzqjnwz1tz/class-alg-wc-custom-order-numbers-core.php?rlkey=3dw7wpaqsw7irrx073mooobpo&dl=0](https://www.dropbox.com/scl/fi/ocwbxztsv5ffzqjnwz1tz/class-alg-wc-custom-order-numbers-core.php?rlkey=3dw7wpaqsw7irrx073mooobpo&dl=0)
    2. After downloading the file, you can replace it with the original file at \wp-
       content\plugins\custom-order-numbers-for-woocommerce\includes folder.
    3. The patch makes the necessary changes to fix the bug and has been tested thoroughly.
       But please make sure you take a backup before replacing the file.
 * Please let me know if you have any questions or issues with the patch.
 *  Thread Starter [nickiova](https://wordpress.org/support/users/nickiova/)
 * (@nickiova)
 * [2 years, 8 months ago](https://wordpress.org/support/topic/php-warning-killed-query/#post-17127657)
 * [@tychesoftwares](https://wordpress.org/support/users/tychesoftwares/)
 * I tested the updated file on a Staging environment with seemingly no issues.
 * This also seems have resolved the previous object caching issue we reported here:
   [https://wordpress.org/support/topic/order-numbers-revert-to-default-post-id-with-details-hidden/](https://wordpress.org/support/topic/order-numbers-revert-to-default-post-id-with-details-hidden/)
 * Do you know exactly when that previous PHP call was used that would trigger the
   warning? I did create and view several orders with the warning not appearing 
   after the update but just want to confirm the exact action.
 * Thank you!
 *  Plugin Author [tychesoftwares](https://wordpress.org/support/users/tychesoftwares/)
 * (@tychesoftwares)
 * [2 years, 7 months ago](https://wordpress.org/support/topic/php-warning-killed-query/#post-17154517)
 * Hi [@nickiova](https://wordpress.org/support/users/nickiova/),
   I’m glad to hear
   that the updated file seems to have resolved the previous object caching issue.
   The change we made was to the query, which now only returns IDs. In contrast,
   the previous query returned all order information, leading to the error. This
   adjustment has seemingly resolved the problem.If you have any further questions
   or require additional information, please don’t hesitate to reach out.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘PHP Warning: Killed Query’ is closed to new replies.

 * ![](https://ps.w.org/custom-order-numbers-for-woocommerce/assets/icon-256x256.
   jpg?rev=2825614)
 * [Custom Order Numbers for WooCommerce](https://wordpress.org/plugins/custom-order-numbers-for-woocommerce/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/custom-order-numbers-for-woocommerce/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/custom-order-numbers-for-woocommerce/)
 * [Active Topics](https://wordpress.org/support/plugin/custom-order-numbers-for-woocommerce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/custom-order-numbers-for-woocommerce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/custom-order-numbers-for-woocommerce/reviews/)

## Tags

 * [php](https://wordpress.org/support/topic-tag/php/)
 * [PHP Warning](https://wordpress.org/support/topic-tag/php-warning/)

 * 5 replies
 * 2 participants
 * Last reply from: [tychesoftwares](https://wordpress.org/support/users/tychesoftwares/)
 * Last activity: [2 years, 7 months ago](https://wordpress.org/support/topic/php-warning-killed-query/#post-17154517)
 * Status: resolved