Zen Cart Logo
Forums / General Questions / Performance issues - making sense of SQL report

Performance issues - making sense of SQL report

Views: 477

Results 1 to 2 of 2
3 Jul 2012, 1:30 PM
#1
jgold723 avatar

jgold723

Zen Follower

Join Date:
Dec 2010
Posts:
362
Plugin Contributions:
0

Performance issues - making sense of SQL report

We find that the backend of our installation can be very slow at times. We have trashed cache/debug files and cleaned the admin records.

The system admin for the hosting company said they ran a report on the SQL queries (example below) and "found many taking a second or more" and suggested we "take a closer look at these".

I'm not really sure what this means -- it sounds like modifying ZC files which I'm sure is not a good idea. Or maybe not. Can anyone shed light on what is meant by "taking a look at the slow queries" and how I might apply that to an action that will actually help?

Here's an (tiny) example of the SQL report they ran:

3 Queries

Total time: 18.372107, Average time: 6.12403566666667

Taking 2.254480 , 5.430797 , 10.686830 seconds to complete

Rows analyzed 10589, 10603 and 10604

SET timestamp=XXX;
SELECT order_id, paypal_ipn_id, payment_status, txn_type, pending_reason
FROM paypal
WHERE txn_id = 'XXX'
ORDER BY order_id DESC LIMIT XXX;

SET timestamp=1341272778;
SELECT order_id, paypal_ipn_id, payment_status, txn_type, pending_reason
FROM paypal
WHERE txn_id = '1N808357D20206047'
ORDER BY order_id DESC LIMIT 1;

7 Jul 2012, 10:15 PM
#2
niccol avatar

niccol

Totally Zenned

Join Date:
Apr 2009
Posts:
2,138
Plugin Contributions:
1

Re: Performance issues - making sense of SQL report

You might ask them why a simple select query is taking up to 10 seconds. It shouldn't even with fairly large tables. There isn't much wrong with the sql statement that you have detailed.

Or change hosting. That would actually be my suggestion.