Page 1 of 1

[MOD] - Log & Analyze DB Queries (15x/2x)

Posted: Fri Oct 29, 2010 8:44 am
by Qphoria
This mod adds a time check around the db query call to show exactly how long database queries are taking so you can track down potential slow queries on your server. This should create a file in the root of your store called "query_time.txt"

This will log all db queries that are called when a page is refreshed like this:

Code: Select all

--- PAGE URL: route=checkout/cart ---

[index.php]
Query Time: 0.0078 :: SELECT * FROM setting
Aggregate: 0.0078

[index.php]
Query Time: 0.0016 :: SELECT * FROM language
Aggregate: 0.0108

[system/library/currency.php]
Query Time: 0.0019 :: SELECT * FROM currency
Aggregate: 0.0127
After each page load, refresh the file directly from the url:

Code: Select all

http://yoursite.com/query_time.txt 
Times should be low in most cases. No more than 0.0050 I would say and even that should only be for very large queries

Re: [MOD] - Log & Analyze DB Queries

Posted: Fri Oct 29, 2010 11:18 am
by kedgetech
Good One Q ! should be handy for troubleshooting.

Re: [MOD] - Log & Analyze DB Queries

Posted: Sun Apr 24, 2011 10:25 pm
by Qphoria
Xsecrets wrote:looks like yes he has alot of categories, but also LOTS of products. I think you need to look at my performance optimization thread. http://forum.opencart.com/viewtopic.php?f=24&t=24391 I think those changes would help you quite a bit as the product query is taking over 4 seconds.
Just use the vQmod script for it here:
http://forum.opencart.com/viewtopic.php ... 91#p126611

Re: [MOD] - Log & Analyze DB Queries (15x/2x)

Posted: Thu Apr 07, 2016 5:05 am
by Qphoria
Updated to add a 2.x version

Re: [MOD] - Log & Analyze DB Queries (15x/2x)

Posted: Thu Apr 07, 2016 5:43 am
by pwuy
Hi dude, im trying to install this, but it returns me "invalid format".

Can you help me? Thanks a lot!

Re: [MOD] - Log & Analyze DB Queries (15x/2x)

Posted: Thu Apr 07, 2016 10:16 pm
by Johnathan
This is a vQmod file, not an ocMod file. You'll need to install vQmod from vqmod.com first, then you can upload it to the /vqmod/xml/ folder.

Re: [MOD] - Log & Analyze DB Queries (15x/2x)

Posted: Fri Apr 08, 2016 12:23 am
by pwuy
Hi Johnathan, thanks for your reply.

query file shows only this: --- PAGE URL: route=product/category&path=60 ---

My problem is detailed here: viewtopic.php?f=190&t=160554

Do you have any idea of what can be happening? Thanks for your help!

Re: [MOD] - Log & Analyze DB Queries (15x/2x)

Posted: Mon Sep 26, 2016 5:36 am
by bibiloute
Hello,

How can i use it for track queries when i click on checkout confirm button.
My site is now very fast except the last step when i click on confirm button it take about 25second to reach the payment gateway it's not good at all im losing order because of this so if i can track what take this much time it would be fantastic

thanks.

Re: [MOD] - Log & Analyze DB Queries (15x/2x)

Posted: Thu Oct 13, 2016 5:15 pm
by dharam81
Hi,

I am trying to use this for 1.5.6. while I refresh the page

it only display as :

--- PAGE URL: route=checkout/cart ---
--- PAGE URL: route=product/product/add --- etc and this keep changing but no query result display.

am I missing any thing?

Re: [MOD] - Log & Analyze DB Queries (15x/2x)

Posted: Sun Feb 19, 2017 1:34 am
by saliverdim
my website .txt not open :/ but robots.txt its works.
I don't now can you help me ? not found page all txt files :((

Re: [MOD] - Log & Analyze DB Queries (15x/2x)

Posted: Thu Mar 09, 2017 2:31 am
by saliverdim
blank page can yoo help me