Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6689023
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T05:28:15+00:00 2026-05-26T05:28:15+00:00

I have a shopping cart that continually logs slow queries like this one… #

  • 0

I have a shopping cart that continually logs slow queries like this one…

# Query_time: 4  Lock_time: 0  Rows_sent: 50  Rows_examined: 454403
    SELECT SQL_CALC_FOUND_ROWS products.*, 
                           descr1.product                          AS product, 
                           Min(prices.price)                       AS price, 
                           GROUP_CONCAT(IF(products_categories.link_type = 'M', 
                           Concat(products_categories.category_id, 
                           'M'), products_categories.category_id)) AS 
                           category_ids, 
                           cscart_seo_names.name                   AS seo_name 
FROM   cscart_products AS products 
       LEFT JOIN cscart_product_descriptions AS descr1 
         ON descr1.product_id = products.product_id 
            AND descr1.lang_code = 'EN' 
       LEFT JOIN cscart_product_prices AS prices 
         ON prices.product_id = products.product_id 
            AND prices.lower_limit = 1 
       INNER JOIN cscart_products_categories AS products_categories 
         ON products_categories.product_id = products.product_id 
       INNER JOIN cscart_categories 
         ON cscart_categories.category_id = products_categories.category_id 
            AND ( cscart_categories.usergroup_ids = '' 
                   OR Find_in_set(0, cscart_categories.usergroup_ids) 
                   OR Find_in_set(1, cscart_categories.usergroup_ids) ) 
            AND cscart_categories.status IN ( 'A', 'H' ) 
       LEFT JOIN cscart_seo_names 
         ON cscart_seo_names.object_id = products.product_id 
            AND cscart_seo_names.TYPE = 'p' 
            AND cscart_seo_names.dispatch = '' 
            AND cscart_seo_names.lang_code = 'EN' 
WHERE  1 
       AND products.company_id = 0 
       AND ( products.usergroup_ids = '' 
              OR Find_in_set(0, products.usergroup_ids) 
              OR Find_in_set(1, products.usergroup_ids) ) 
       AND products.status IN ( 'A' ) 
       AND prices.usergroup_id IN ( 0, 0, 1 ) 
GROUP  BY products.product_id 
ORDER  BY descr1.product ASC 
LIMIT  1300, 50; 

I can’t seem to get any help from the cart company on how to speed this query up. Maybe I need to add more indexes? I am not sure and would love to get some help that would point me in t right direction to solving this problem.

Thanks,

Chris Edwards

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T05:28:16+00:00Added an answer on May 26, 2026 at 5:28 am

    I see a lot of issues with this query that could be causing slowness…

    First of all, anywhere you are using ‘FIND_IN_SET’, try using IN instead. By removing the ‘OR’ in the conditions, indexes can be used:

    cscart_categories.usergroup_ids = ''
    OR FIND_IN_SET(0, cscart_categories.usergroup_ids)
    OR FIND_IN_SET(1, cscart_categories.usergroup_ids)
    

    Becomes:

    cscart_categories.usergroup_ids IN ('', '0', '1')
    

    Other than that, make sure that every column that is being used in a join, group by clause, where clause, or ordering is indexed.

    Another suggestion would be to remove the ‘GROUP_CONCAT’ and select that information separately in another query.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a shopping cart which at this point in time sends items that
I have a shopping cart that displays product options in a dropdown menu and
I have a shopping cart script that I am trying to modify to support
I have been working on a shopping cart that the user can add/remove order
I have a shopping Cart that contains many cart item and price or the
I'm making a shopping cart. In one tab, I have a table view controller
I have a shopping cart page (Cart.aspx) that has a button that will (sometimes)
I have a checkout process for a shopping cart that is currently storing credit
I have shopping cart web application. when I am running that in my local
I have designed a shopping cart that allows both login and non-login users to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.