Bagisto Forum

    Bagisto

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups

    Large datasets: 1.5 million products (or more)

    General Discussion
    4
    4
    259
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • B
      Bart last edited by

      Re: 1 Million products!

      Hi,

      I am testing a setup of bagisto with 1.5 million products to see if it can handle a large amount of products.

      I noticed it takes over 2 seconds for a category page to load with just 9 products on it. After some fiddling around I discovered the query used is slowed down by the group by `product_flat`.`id` at the end of the query.

      When removing the group by the query takes 0.025 on average and when adding the group by the query takes 0.45 on average.

      The product flat query:

      select distinct `product_flat`.* from `product_flat`
      left join `products` on `product_flat`.`product_id` = `products`.`id`
      left join `product_categories` on `products`.`id` = `product_categories`.`product_id` 
      left join `product_flat` as `flat_variants` on `product_flat`.`id` = `flat_variants`.`parent_id` and `flat_variants`.`channel` = 'default' and `flat_variants`.`locale` = 'en'
      left join `products` as `variants` on `products`.`id` = `variants`.`parent_id` 
      where `product_flat`.`channel` = 'default' and `product_flat`.`locale` = 'en' and `product_flat`.`url_key` is not null and `product_categories`.`category_id` = '44' and `product_flat`.`status` = 1 and `product_flat`.`visible_individually` = 1 
      group by `product_flat`.`id`
      limit 9 offset 0;
      

      Another thing I noticed was when opening a product page it took 5 seconds. This was due to the fact it uses "url_key" to select the product but there was no index on "url_key". Adding that index solved the problem.

      1 Reply Last reply Reply Quote 0
      • R
        rahul last edited by

        Hi @Bart

        Thanks for your concern, we will check and implement solution shortly.

        1 Reply Last reply Reply Quote 0
        • M
          Manpreet last edited by

          I am facing the same problem. any solution or feedback to this will be really helpful?

          admin 1 Reply Last reply Reply Quote 0
          • admin
            admin @Manpreet last edited by

            @Manpreet May I know which version of Bagisto you are using currently?

            1 Reply Last reply Reply Quote 0
            • First post
              Last post