• Resolved brxdev

    (@brxdev)


    Dear Thomas,

    first of all we really like the ISC plugin and are using it since beta. But, due to our latest performance review of or server we have figured out that ISC does a lot of heavy database work by running some SQL queries over and over. We don’t really understand why this happens and runs so often. Sure, we can see it is a heavy join… but can you help by answering a free questions?

    • What does this SQL query do?
    • Why it might run over and over on our machine?
    • Do you have any tips to improve the SQL load in your plugin?

    Our WP data:

    • ~8.000 post articles
    • ~24,755 media items

    SQL Query as Code:

    ´SELECT   xyz_wp_posts.ID
    					 FROM xyz_wp_posts  
                    LEFT JOIN xyz_wp_postmeta ON ( xyz_wp_posts.ID = xyz_wp_postmeta.post_id )  
                    LEFT JOIN xyz_wp_postmeta AS mt1 ON ( xyz_wp_posts.ID = mt1.post_id )  
                    LEFT JOIN xyz_wp_postmeta AS mt2 ON ( xyz_wp_posts.ID = mt2.post_id AND mt2.meta_key = 'isc_image_source' )
    					 WHERE 1=1  AND (
      (
        ( xyz_wp_postmeta.meta_key = 'isc_image_source' AND xyz_wp_postmeta.meta_value = '' )
        AND
        ( mt1.meta_key = 'isc_image_source_own' AND mt1.meta_value != '1' )
      )
      OR
      mt2.post_id IS NULL
    ) AND xyz_wp_posts.post_type = 'attachment' AND ((xyz_wp_posts.post_status = 'inherit'))
    					 GROUP BY xyz_wp_posts.ID
    					 ORDER BY xyz_wp_posts.post_date DESC
    					 LIMIT 0, 100

    SQL Query as Screenshot:
    https://ibb.co/yV49DB7

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Thomas Maier

    (@webzunft)

    Hey brxdev,

    thanks for reaching out and your kind words about ISC.

    The query is calculating missing image sources and should only run in the backend. Do you also see it in the frontend?

    I looked into it and could imagine to do more caching.

    Before doing so, I would like to learn more about the impact on your system. Could you install the Query Monitor plugin and let me know the performance data of that query in there? Mainly the time it takes and the rows it finds?

    Thanks,
    Thomas

    Plugin Author Thomas Maier

    (@webzunft)

    Hey @brxdev, did you see my reply and could make any progress in analyzing the issue?

    Thanks,
    Thomas

    Thread Starter brxdev

    (@brxdev)

    Hi Thomas,

    Yes, we have identified some issues on our side. I sent you some data points maybe this is useful for you.

    Thanks for your support.

    • This reply was modified 6 months, 1 week ago by brxdev.
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘DB performance issues by heavy ISC SQL queries’ is closed to new replies.