Jump to content
dix4life

3 contributions with a lot of DB queries! Please help reduce them!

Recommended Posts

Hello,

 

I've 3 big queries in my shop. Is there someone how can rewrite the contributions? This will be for all users here a great solution! I've installed a querie read tool so i can see on every page how many queries and wich queries are beeing loaded.

 

1. select specials_new_products_price from specials where products_id = '7230' and status

This Is the standard special price querie from Oscommerce i believe. I got this on the products_new.php page. The querie loads for EACH product again. So i have 20 queries for loading on the special price. All products have normaling pricing.

 

2. I have installed this contribution: http://addons.oscommerce.com/info/2251 I've allready installed the querie reduce contri for the categories. But this contri for an advanced search box on every page also loads the categorie querie. select c.categories_id, cd.categories_name from categories c, categories_description cd where parent_id = '31' and c.categories_id = cd.categories_id and cd.language_id = '4' order by sort_order, cd.categories_name. In my case an extra 35 queries on every page!!! Can someone please look at this beautyfull contri and make it less querie needed please? Thanks!

 

3. The last contri i have installed how loads a lot of queries is http://addons.oscommerce.com/info/6674. This is also a very nice contri but also takes a lot of queries! I think this is also a simple mod to get the querie count less.

 

I hope someone can help us to rewrite some code to minimize the querie counts. Thanks in advanced all of you!

 

Best regards,

 

Martin

Share this post


Link to post
Share on other sites

You should be trying to reduce the total query time, not the number of queries. Several small queries may be faster than one big one, so reducing the number of queries may actually make your pages slower. I would start with the slowest query and see what I could do to optimize it.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×