 | |  | | | Photopost Pro Bug Reports Post post installation PhotoPost Pro problems here. |
September 19th, 2006, 12:41 PM
|
#1 (permalink)
| | Member Verified Customer
Join Date: Oct 2002 Location: Germany
Posts: 254
| Slow queries - what causes them
Hi,
I want to track down what causes this type of slow query (our s-q-log is full of these).
Which file exectute this kind of queries?
Thanks
Thomas
# Time: 060919 17:52:47
# User@Host: xxxxxxxxxxx @ xxxxxxx [10.0.0.2]
# Query_time: 12 Lock_time: 0 Rows_sent: 206685 Rows_examined: 413370
SELECT id,user,userid,cat,storecat,date,title,description,keywords,bigimage,width,height,filesize,views,medwidth,medheight,medsize,approved,rating,allowprint,numcom,lastposter FROM photos WHERE approved < 2 ORDER BY disporder,date DESC;
|
| |
September 19th, 2006, 01:55 PM
|
#2 (permalink)
| | Photopost Developer Verified Customer
Join Date: Jun 2002 Location: Abingdon,MD
Posts: 71,689
|
Possible spider on your site. There is nothing technically wrong with the query itself. it is only called in one place on the gallery. If you hit on the indexhead the ALL link and it shows all photos
Why out of couriosity do you have over 20000 unapproved photos?
|
| |
September 19th, 2006, 02:14 PM
|
#3 (permalink)
| | Member Verified Customer
Join Date: Oct 2002 Location: Germany
Posts: 254
|
Hi Chuck,
thanks for the prompt answer. Which file contains the query? Edit: found it Quote: |
Why out of couriosity do you have over 20000 unapproved photos?
| I have no idea - I guess it was a former pp bug
Thanks
Thomas
|
| |
September 19th, 2006, 02:31 PM
|
#4 (permalink)
| | Photopost Developer Verified Customer
Join Date: Jun 2002 Location: Abingdon,MD
Posts: 71,689
|
Query_time: 12 Lock_time: 0 Rows_sent: 206685 Rows_examined: 413370
I mean 200000. what is in your unapproved que? Maybe I am just reading it wrong
|
| |
September 19th, 2006, 02:59 PM
|
#5 (permalink)
| | Member Verified Customer
Join Date: Oct 2002 Location: Germany
Posts: 254
|
It is just a strange output from mysql - we only have 200K photos in total.
rows examined = 2*rows sent - why - I don't know.
I added a limit 1000 to the query which should avoid the slow query
|
| |
September 19th, 2006, 03:23 PM
|
#6 (permalink)
| | Photopost Developer Verified Customer
Join Date: Jun 2002 Location: Abingdon,MD
Posts: 71,689
|
yeah indeed strange output
Yeah well you might want to change your wording for that template to say last 1000 not all
|
| |
September 25th, 2006, 01:34 PM
|
#7 (permalink)
| | Member Verified Customer
Join Date: Oct 2002 Location: Germany
Posts: 254
|
another one, which causes slow queries and table locking:
SELECT * FROM comments WHERE comment != '' ORDER BY date DESC;
from which file this is issued?
(please add filename (php_self) in future pp-versions as comment in sql - makes troubleshooting much easier)
|
| |
September 25th, 2006, 02:59 PM
|
#8 (permalink)
| | Photopost Developer Verified Customer
Join Date: Jun 2002 Location: Abingdon,MD
Posts: 71,689
|
It is in comshow.php
|
| |
October 10th, 2006, 01:08 PM
|
#9 (permalink)
| | Member Verified Customer
Join Date: Jan 2003 Location: NY
Posts: 214
|
how did you fix this slow querying? We too are having performance issues on our site and losing valuable viewership and member visits due to it.
|
| |
October 10th, 2006, 01:11 PM
|
#10 (permalink)
| | Member Verified Customer
Join Date: Oct 2002 Location: Germany
Posts: 254
|
A quick solution is to add limit clauses to the respective queries...
|
| |
November 9th, 2006, 09:55 PM
|
#11 (permalink)
| | Member Verified Customer
Join Date: Jan 2003 Location: NY
Posts: 214
|
how would one do that precisely?
|
| |
November 9th, 2006, 10:43 PM
|
#12 (permalink)
| | Member Verified Customer
Join Date: Oct 2002 Location: Germany
Posts: 254
|
find the query, add ad the end e.g. "limit 1000"
You should know what you are doing, because it might have strange sideeffects (e.g. if pp is using the select to build pagination or something like that...)
|
| | |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | | | | Thread Tools | | | | Display Modes | Rate This Thread | Linear Mode | |
Posting Rules
| You may not post new threads You may not post replies You may not post attachments You may not edit your posts HTML code is Off | | |
Similar Threads | | Thread | Thread Starter | Forum | Replies | Last Post | | slow queries - photopost | RCA | Photopost Pro Bug Reports | 5 | November 10th, 2006 09:37 AM | | my PhotoPost si very slow | mehbara | Photopost Pro Installation & Upgrades | 1 | August 22nd, 2006 06:26 PM | | queries | BrandiDup | Before You Buy | 4 | February 25th, 2006 03:16 PM | All times are GMT -5. The time now is 01:00 AM. | |