• Resolved jc111

    (@jc111)


    Hello,

    Sometimes I’ll get a null response for this plugin and check the error logs and find this:

    KILLED QUERY (17773 characters long generated in /path/to/wp-content/plugins/shortpixel-image-optimiser/class/db/wp-shortpixel-media-library-adapter.php:59): SELECT post_id, meta_key, meta_value FROM wp_postmeta WHERE post_id IN (14,18,19,20,21,22,23,24,28,30,31,32,33,34,35,36,38,39,40,41,43,68,74,138,158,159,160,195,196,197,199,200,201,207,208,209,210,211,212,213,214,227,228,229,232,239,240,241,242,243,244,260,272,273,279,280,292,293...

    Can you tell me what can cause this? I assume it is because since I am converting some product images in woocommerce so the image/thumbnails are all attached to orders (and since doing a png to jpg has to check and replace all image filenames for all locations). Would I be correct?

    Could there be a better way or maybe a two-step process that might make it fail less?

    Thanks!

Viewing 1 replies (of 1 total)
  • Hi there,

    There’s a function that counts all processable posts and it’s trying indeed to query as much as possible. It seems that you have more than 10.000 posts, and the SQL server has a limit on character amount.

    You can try to dial it down via a filter we have shortpixel/db/chunk_size.

    For example, try to insert this line in your functions.php file:
    add_filter(''shortpixel/db/chunk_size'', function($limit) { return 5000; } );

    Cheers,

Viewing 1 replies (of 1 total)

The topic ‘Long Query Error’ is closed to new replies.