• Hello,
    searching with Ajax Search Lite takes more than 20 seconds since some time. I’m not sure how to debug this issue. I can send debug data and give access to FTP/administrator account for debugging.
    Cheers

    The page I need help with: [log in to see the link]

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author wpdreams

    (@wpdreams)

    Hi,

    May I ask how many posts do you have to search?

    Thread Starter r3crac

    (@r3crac)

    There are 19,558 posts. It was searching faster earlier (2-3 seconds).

    Plugin Author wpdreams

    (@wpdreams)

    Then something must have been changed.

    I would suggest only the title search for so many items – searching other fields can get stressful for the server.
    Part1: https://i.imgur.com/OG3KQ2H.png
    Part2: https://i.imgur.com/HMpoXaD.png
    If any of those was enabled, turning them off will give you a huge difference.

    Thread Starter r3crac

    (@r3crac)

    The thing is that I’ve turned them off and there is no difference! It’s searching only in title, but it’s still 15 seconds or so. I’ve changed it back to search in title and content (I need to search in content, coz it’s searching for shop links). I’ve added a little bit of code to the plugin, but it doesn’t affect speed:

    if (preg_match('/.+banggood.com.+/', $s))
    			{
    				preg_match('/(p\\-[0-9]+)\\.html/', $s, $matches);
    				$s = $matches[0];
    			}
    
    			if (preg_match('/.+gearbest.com.+/', $s))
    			{
    				preg_match('/(pp\\_[0-9]+)\\.html/', $s, $matches);
    				$s = $matches[0];
    			}

    Also saving changes in posts (updating posts) takes more time than usual. Something wrong with database? I’ve deleted old stuff using WP Sweep and optimized database – didn’t work.

    • This reply was modified 4 years, 11 months ago by r3crac.
    • This reply was modified 4 years, 11 months ago by r3crac.
    Plugin Author wpdreams

    (@wpdreams)

    Also saving changes in posts (updating posts) takes more time than usual. Something wrong with database?

    Can be, or something else is running in the background that takes a lot of time during the database requests.
    I would suggest running a defragmentation query directly on the database.

    Thread Starter r3crac

    (@r3crac)

    I’ve checked searching with Query Monitor plugin. Here is SQL Query ( https://website.com/?s=viofo ) that is super slow (19 seconds this time):

    SELECT SQL_CALC_FOUND_ROWS 75b_posts.ID
    FROM 75b_posts
    WHERE 1=1
    AND (((75b_posts.post_title LIKE '%viofo%')
    OR (75b_posts.post_excerpt LIKE '%viofo%')
    OR (75b_posts.post_content LIKE '%viofo%')))
    AND 75b_posts.post_type IN ('post', 'page', 'attachment')
    AND (75b_posts.post_status = 'publish'
    OR 75b_posts.post_author = 1
    AND 75b_posts.post_status = 'private')
    ORDER BY 75b_posts.post_title LIKE '%viofo%' DESC, 75b_posts.post_date DESC
    LIMIT 0, 10

    This is the caller:

    WP_Query->get_posts()
    Main Query

    Screenshot:

    View post on imgur.com

    Here is another query, but it’s faster (1 second):

    SELECT 75b_posts.*
    FROM 75b_posts
    WHERE 1=1
    AND 75b_posts.ID IN (19327,13600,19324,330444,283013,330413,587881,610705,628185,628183,639260,1150866,1280541,1380663,1536242,2141749,4102953,4881216,4885577,4882266,4881347,4882005,4883739,4883740,5010699,5081700,5081697,5224840,5623788,5692541,5777727,5804331,5834759,5896805,6030583,6660368,6592214,6660365)
    AND 75b_posts.post_type = 'post'
    AND ((75b_posts.post_status = 'publish'))
    ORDER BY 75b_posts.post_date DESC

    Screenshot:

    View post on imgur.com

    Do you have any idea what to do to improve speed of searching and posting/updating?

    Plugin Author wpdreams

    (@wpdreams)

    Hi,

    Those queries are not coming from this plugin.
    The first one seems to be counting the results or something similar. With a heavy database that can be very slow. I don’t know how to disable that though, as it is not coming from this plugin.

    Best,
    Ernest M.

    Thread Starter r3crac

    (@r3crac)

    OK, thanks for your help!

    Thread Starter r3crac

    (@r3crac)

    I’ve changed database type of wp_posts to MyIsam (from InnoDB), repaired and optimized this table and searching is loading faster now (ATM it takes like 2-3 seconds): https://couponsfromchina.com/?s=viofo
    Searching via Ajax Search Lite is still slow – it takes like 8-10 seconds to search for something. I don’t know what to do with this.

    • This reply was modified 4 years, 11 months ago by r3crac.
Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Very slow searching’ is closed to new replies.