• Hi!

    I have a problem with slow queries on my site. I noticed high time to first byte on my server. I contacted my host and they told me that this query takes up to 3 seconds. This is the query:

    SELECT SQL_CALC_FOUND_ROWS X5i3v_posts.ID FROM X5i3v_posts WHERE 1=1 AND X5i3v_posts.post_type = ‘ad_listing’ AND (X5i3v_posts.post_status = ‘publish’ OR X5i3v_posts.post_status = ‘tr_pending’ OR X5i3v_posts.post_status = ‘tr_failed’ OR X5i3v_posts.post_status = ‘tr_completed’ OR X5i3v_posts.post_status = ‘tr_activated’) ORDER BY RAND() LIMIT 0, 10

    I have a loooot of posts. Now I know that SQL Calc Found Rows takes more time the bigger the database gets. Is there any way to disable or workaround this query?

    I found a lot of old posts which doesn’t really help with the new wordpress and the files don’t refer to the latest wordpress files.

    Please help me with this.

    Warm greetings

    Julia

Viewing 6 replies - 1 through 6 (of 6 total)
  • Moderator keesiemeijer

    (@keesiemeijer)

    Hi M4rk0444

    On what page do you have this query?

    I think the query is used to find the maximum posts amount for pagination.
    Do you need pagination on that page?

    Thread Starter M4rk0444

    (@m4rk0444)

    Hi keesiemeijer!

    Thank you for your answer! You can see it here on: https://www.firmenvorstellung.com

    It is using the query already on the home page.
    If you enter the site you will notice the long time to first byte. The page rendering is fast.

    How can I work around this query?

    Moderator keesiemeijer

    (@keesiemeijer)

    Alas, there is not much I can do to help as this is a commercial theme, and I would have to guess in what file and how the query is made.

    Contact your theme support for this issue.

    This could be a possible solution.
    https://wordpress.stackexchange.com/questions/71381/how-to-disable-sql-calc-found-rows

    Thread Starter M4rk0444

    (@m4rk0444)

    Thank you for your answer. So you guess it is a theme specific problem?
    If you want I could provide you a test account information to take a look at it.

    Thank you for your help.
    Julia

    Moderator keesiemeijer

    (@keesiemeijer)

    I’m sorry but that’s not allowed here.

    I could potentially be liable for any potential damage that could be caused by me or by anyone else accessing the system after me.

    Moderator keesiemeijer

    (@keesiemeijer)

    To answer one of your other questions.

    So you guess it is a theme specific problem?

    Try de-activating all plugins to see if the query is gone.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Slow query – SQL Calc rows found’ is closed to new replies.