Product Filters (Attributes)

Optimize the sql queries - Product Filters (Attributes)

Optimize the sql queries

by radhavallabh » Wed May 17, 2023 12:15 pm

Hi dear;
Is there a way to optimise the queries made by this addon?
As select distinct pov.* is causing heavy load on server and keeps continuing to parse for long periods...
Regds./
radhavallabh
radhavallabh
VIP Member
VIP Member
Posts: 364
Joined: Tue Oct 27, 2020 4:09 am
Contact:

Re: Optimize the sql queries

by Kofod95 » Thu May 18, 2023 7:29 am

There are probably several ways to improve.
Changing the wildcards for the actual wanted data may help some (pov.* to pov.options_values_id, pov.options_values_name - based on memory, so the actual fields may be named differently).
I was toying with the idea of making a class to contain all possible filters, and then pick the relevant ones from that. I'm not quite sure if it will help, but it's something I'm experimenting with.

I have an update for this add-on that changes a lot of the code, but also adds some features, which might also help a bit with the speed. I have it working on a store with 5k+ products, where it filters for specifications and product data without feeling slow. The code needs some cleaning still and I'm quite busy with studies and life in general, but I plan on having it ready to release here in a month or so.

//Daniel
I'm not smart, but sometimes even a blind chicken can find a corn.
Here are a lot of corns: Phoenix user guide
User avatar
Kofod95
VIP Member
VIP Member
Posts: 605
Joined: Sat Feb 06, 2021 7:38 pm
Contact:

Re: Optimize the sql queries

by radhavallabh » Thu May 18, 2023 11:38 am

Kofod95 wrote:There are probably several ways to improve.
Changing the wildcards for the actual wanted data may help some (pov.* to pov.options_values_id, pov.options_values_name - based on memory, so the actual fields may be named differently).
I was toying with the idea of making a class to contain all possible filters, and then pick the relevant ones from that. I'm not quite sure if it will help, but it's something I'm experimenting with.

I have an update for this add-on that changes a lot of the code, but also adds some features, which might also help a bit with the speed. I have it working on a store with 5k+ products, where it filters for specifications and product data without feeling slow. The code needs some cleaning still and I'm quite busy with studies and life in general, but I plan on having it ready to release here in a month or so.

//Daniel
Thanks for the reply dear;
Shall await your update...
Thank you in advance,
Warm Regds./
radhavallabh
radhavallabh
VIP Member
VIP Member
Posts: 364
Joined: Tue Oct 27, 2020 4:09 am
Contact:

Re: Optimize the sql queries

by Kofod95 » Thu May 18, 2023 1:05 pm

And thank you very much for your interest and input on the add-on! It gives me joy that others can have use of something I've made, and the inputs from users is essential for me to improve the add-on, so thank you once again!

//Daniel
I'm not smart, but sometimes even a blind chicken can find a corn.
Here are a lot of corns: Phoenix user guide
User avatar
Kofod95
VIP Member
VIP Member
Posts: 605
Joined: Sat Feb 06, 2021 7:38 pm
Contact: