Forums / General Questions / Number of Queries: 29416 - Query Time: 23.5 - Parse Time: 25.4 -

Number of Queries: 29416 - Query Time: 23.5 - Parse Time: 25.4 -

Locked

Views: 2,869

Results 1 to 5 of 5
This thread is locked. New replies are disabled.
28 Apr 2009, 10:17 PM
#1
kevinw avatar

kevinw

New Zenner

Join Date:
Mar 2007
Posts:
47
Plugin Contributions:
0

Number of Queries: 29416 - Query Time: 23.5 - Parse Time: 25.4 -

Long queries - site times out - options to fix?...
Why are there so many queries when moving into Checkout?
Need suggestions on how you have solved this problem...

A shopping cart with 15 items from catalog of 700 products - each item has 1 attribute selection Y/N ...
Parse Time: 25.415 - Number of Queries: 29416 - Query Time: 23.56

Suggestions? How do you work around this?.. We just deleted older items in the customer_basket (_attributes) tables, makes no difference (reduced from 2500 to 500 records)

The regular shopping page - logged in
Parse Time: 4.203 - Number of Queries: **2392 **- Query Time: 2.27125280191

Shopping page - not logged in
Parse Time: 0.430 - Number of Queries: **50 **- Query Time: 0.175738614624

product List - 14 items
Parse Time: 5.728 - Number of Queries: **431 **- Query Time: 3.40070589308

Shopping cart - 1 items in cart
Parse Time: 3.784 - Number of Queries: **405 **- Query Time: 2.19882865305

Add 1 item that has no attributes - new customer
Parse Time: 1.042 - Number of Queries: **111 **- Query Time: 0.279970555527

List products - 29 in list - each with an image
Parse Time: 0.767 - Number of Queries: **428 **- Query Time: 0.376708670792

order 1 of these with 1 attribute (Y/N) - View Shopping cart
Parse Time: 0.735 - Number of Queries: **402 **- Query Time: 0.34228374794
Home with 1 item in shopping cart
Parse Time: 0.652 - Number of Queries: **166 **- Query Time: 0.105904290329

Check out - with 1 product
Parse Time: 1.568 - Number of Queries: **1043 **- Query Time: 0.863715993027

Add 1 item that has 1 attribute to select between 2 choices

Checkout with 2 products
Parse Time: 12.731 - Number of Queries: **2033 **- Query Time: 10.8619049131

A shopping cart with 15 items - 700 products - each item has 1 attribute selection between 2 items...
Parse Time: 25.415 - Number of Queries: 29416 - Query Time: 23.56

zen-cart 1.3.7 - fresh install (2 years ago...)
hosted on godaddy - but this doesn't account for the large numbers of queries... Though when godaddy servers are busy this does cause some timeouts...

We need to understand and reduce the number of queries...for a limited number of products/selected items...
Suggestions? Help!!!???!!!???

Thanks...
KevinW

29 Apr 2009, 12:39 AM
#2
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Number of Queries: 29416 - Query Time: 23.5 - Parse Time: 25.4 -

See this thread and towards the end the settings that helped

http://www.zen-cart.com/forum/showthread.php?t=125304

Zen-Venom Get Bitten

29 Apr 2009, 5:15 AM
#3
kevinw avatar

kevinw

New Zenner

Join Date:
Mar 2007
Posts:
47
Plugin Contributions:
0

Re: Number of Queries: 29416 - Query Time: 23.5 - Parse Time: 25.4 -

Thanks - not sure the referenced thread will address the problem I see...
I don't have any of the centerboxes turned on as I see them...

They are all 0 (off) except
New Products Columns per Row 4
Featured Products Columns per Row 3
Special Products Columns per Row 3
Filter Product Listing for Current Top Level Category When Enabled 1

I want to avoid converting to 1.3.8a unless someone thinks it will actually help - it will take much work and would like some confidence it might help...

I have another site (in dev) on 1.3.8 and it too generates lots of queries for an order of 20 items...

I can ask the host (godaddy) - but 39,000 queries still seems to be a huge amount for an order of 20 items, let alone 100 (which has happened and the site times out) I am thinking of recreating the site with no attributes - just product A and Product B - instead of Product Attrib A/B. Which will take a database unload, process, reload.

As for indexes, the files all are as the install specified - is there something I should check?...

Ideas on how to debug from people that have already traveled down this path?... thanks....

KevinW

29 Apr 2009, 10:51 PM
#4
dermanomann avatar

dermanomann

New Zenner

Join Date:
Feb 2006
Location:
New Zealand
Posts:
146
Plugin Contributions:
1

Re: Number of Queries: 29416 - Query Time: 23.5 - Parse Time: 25.4 -

It might be more work that you are prepared to do, but using ZenMagick will help reduce the number of queries quite a bit. Most of the optimizations have been done on the browsing site, but the next release will include some big improvements in the checkout area too.

For example, adding this product: demo.zenmagick.org/product/34 to the cart will currently result in (depending on sidebox settings, etc):
Zen Cart $db: SQL queries: 639, and ZenMagick database queries SQL queries: 78

The current trunk code needs only:
Zen Cart $db: SQL queries: 346, ZenMagick SQL queries: 154,

Not sure if it is worth the hassle for you moving to ZenMagick would require to use the ZenMagick theme code. That, in turn, would require to re-implement your store layout in ZM...

However, it might be an alternative for a new store.

Cheers, mano
Disclosure: I am the main developer of ZenMagick - an alternative templating system and OO API for Zen Cart 1.3.

PS: ZenMagick requires zen cart 1.3.8 and PHP 5.2.x

30 Apr 2009, 2:01 AM
#5
dermanomann avatar

dermanomann

New Zenner

Join Date:
Feb 2006
Location:
New Zealand
Posts:
146
Plugin Contributions:
1

Re: Number of Queries: 29416 - Query Time: 23.5 - Parse Time: 25.4 -

In fact, even more impressive are the differences when looking at this page: demo.zenmagick.org/product/34/22 and toggling between the ZenMagick theme and zen cart template (the toggle link in the top right corner).
The numbers are similar to this:

With zen cart: Parse Time: 1.602 - Number of Queries: 1397 - Query Time: 0.392447394135
With ZenMagick: db: SQL queries: 22, duration: 0.0254 seconds; database (ZMPdoDatabase): SQL queries: 130, duration: 0.1699 seconds;

mano