• Resolved andi22

    (@andi22)


    Hi 123 Host,

    as I noticed, SpeakOut! is causing some slow queries. Query Monitor tells me the following:

    Query:

    SELECT wp_cpkdnz_dk_speakout_petitions.*, COUNT( wp_cpkdnz_dk_speakout_signatures.id ) AS ‘signatures’
    FROM wp_cpkdnz_dk_speakout_petitions
    LEFT JOIN wp_cpkdnz_dk_speakout_signatures
    ON wp_cpkdnz_dk_speakout_petitions.id = wp_cpkdnz_dk_speakout_signatures.petitions_id
    AND ( wp_cpkdnz_dk_speakout_signatures.is_confirmed != ‘0’ )
    WHERE wp_cpkdnz_dk_speakout_petitions.id = 117
    GROUP BY wp_cpkdnz_dk_speakout_petitions.id

    Caller:

    dk_speakout_Petition->retrieve()

    Can we somehow speed that up?

    Thanks!

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author SpeakOut!

    (@123host)

    I notice that this is petition #117. How many active petitions do you have?
    How many total signatures in all petitions? How many in that petition?

    • This reply was modified 4 years, 6 months ago by SpeakOut!.
    Thread Starter andi22

    (@andi22)

    Totel signature count is around 700,000, with 10,000 to 25,000 per petition.

    I’ve got 23 active petitions, from a total of 57 petitions. I have already deleted some old petitions.

    Does deactivating a petition, so that is still there but can’t be signed any more, help to increase the loading speed?

    Plugin Author SpeakOut!

    (@123host)

    That is a lot of signatures – which of course is good if you have a campaign going, but depending on your server, you may be pushing the limit.

    In case you don’t understand the SQL statement, it is counting how many signatures are in petition ID 117.

    I have just checked and in the database I notice there is no index on the Petition ID column in the signatures table. This would likely speed things up.

    I will add this in an update. You can do it yourself. In case you don’t know how to add an index:

    First: BACK UP YOUR DATABASE and download the backup.

    Then cpanel > phpmyadmin > open the database for your wordpress site – if you have more than one site you can open the wp_options table in each database and see the URL.

    When you have the correct database click wp_dk_signatures > structure tab > at the bottom of the list of fields are indexes, create an index on 1 column > go

    In the popup name = petitionID, index choice = index, leave size blank then click go and you will have an index on the petition ID

    I will be interested in hearing if this helps

    Plugin Author SpeakOut!

    (@123host)

    I have done this in 2.3.0

    Thread Starter andi22

    (@andi22)

    WOW – that decreases the loading times tremendously!

    A 1000 thanks to you, you are doing really a fantastic job. I’ve just sent you a litte donation as tribute to your great work. Helps us so much!

    Plugin Author SpeakOut!

    (@123host)

    Great to hear it worked and thanks for your generosity.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Slow Queries’ is closed to new replies.