PhotoPost Photo Gallery Sales PhotoPost Sales Toll Free Phone Number
Mon-Fri 9am-4pm EST
  PhotoPost Photo Sharing Photo Gallery    Visualize community tm
| | | | | | | | |

Go Back   PhotoPost Community > PhotoPost Support > PhotoPost Pro Support Forums > Photopost Pro How Do I...?

Photopost Pro How Do I...? Wondering how to do things in PhotoPost?

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
Old September 21st, 2007, 09:23 AM   #1 (permalink)
Member
Verified Customer
 
Join Date: Mar 2002
Posts: 496
Large Rowscans - Can this be improved?

I'm trying to do some tuning to MySQL to help with performance.

I saw this in my slow query log:

Code:
Content visible to verified customers only.
Can this be improved?
pgowder is offline   Reply With Quote
Old September 23rd, 2007, 08:54 AM   #2 (permalink)
Photopost Developer
Verified Customer
 
Chuck S's Avatar
 
Join Date: Jun 2002
Location: Abingdon,MD
Posts: 68,069
That is not a large rowscan. That should a very explicit result as thats what the query is asking for a specific record, there is no pulling of unneeded information.
__________________
Photopost Developer and Support Engineer

Please do not PM me for support or sales questions. Thank you for your understanding.
Chuck S is online now   Reply With Quote
Old September 23rd, 2007, 08:56 AM   #3 (permalink)
Member
Verified Customer
 
Join Date: Mar 2002
Posts: 496
Quote:
Originally Posted by Chuck S View Post
That is not a large rowscan. That should a very explicit result as thats what the query is asking for a specific record, there is no pulling of unneeded information.
Then why did it examine 17k rows to get the result?
pgowder is offline   Reply With Quote
Old September 23rd, 2007, 09:01 AM   #4 (permalink)
Photopost Developer
Verified Customer
 
Chuck S's Avatar
 
Join Date: Jun 2002
Location: Abingdon,MD
Posts: 68,069
I am just telling you the query is not this

SELECT exifinfo FROM exif

the query is this and we only are pulling information for one entry.

SELECT exifinfo FROM exif WHERE photoid=19367

If you enter this query in phpmyadmin the results you get are ONE ENTRY. There is no way to optimize that query it is already the best it can every be.

I am not a mysql wizard here but issuing a direct specific query to pull one row of information is about as good as your gonna get. Sometimes depending on the query doing JOINED queries as you see in some portions of the script as we do can save time. In this case the query called is done because you are electing to show exif information on a photo.
__________________
Photopost Developer and Support Engineer

Please do not PM me for support or sales questions. Thank you for your understanding.
Chuck S is online now   Reply With Quote
Old September 23rd, 2007, 09:05 AM   #5 (permalink)
Member
Verified Customer
 
Join Date: Mar 2002
Posts: 496
Quote:
Originally Posted by Chuck S View Post
I am just telling you the query is not this

SELECT exifinfo FROM exif

the query is this and we only are pulling information for one entry.

SELECT exifinfo FROM exif WHERE photoid=19367

If you enter this query in phpmyadmin the results you get are ONE ENTRY. There is no way to optimize that query it is already the best it can every be.

I am not a mysql wizard here but issuing a direct specific query to pull one row of information is about as good as your gonna get. Sometimes depending on the query doing JOINED queries as you see in some portions of the script as we do can save time. In this case the query called is done because you are electing to show exif information on a photo.
It appears that this happens when there is no exif information for a photo.

So you don't have logic in there for when there is no exif. It just scans the entire table looking for it. You need to have some logic to prevent the rowscan when there isn't exif information.
pgowder is offline   Reply With Quote
Old September 23rd, 2007, 09:14 AM   #6 (permalink)
Photopost Developer
Verified Customer
 
Chuck S's Avatar
 
Join Date: Jun 2002
Location: Abingdon,MD
Posts: 68,069
Not many things we can do but I will pass it along although incase something comes to mind.
__________________
Photopost Developer and Support Engineer

Please do not PM me for support or sales questions. Thank you for your understanding.
Chuck S is online now   Reply With Quote
Old September 23rd, 2007, 09:40 AM   #7 (permalink)
Member
Verified Customer
 
Join Date: Mar 2002
Posts: 496
Quote:
Originally Posted by Chuck S View Post
Not many things we can do but I will pass it along although incase something comes to mind.

Thanks! In my slow query log this is showing up hundreds of times. It's doing it every time a user views any photo that doesn't have exif. Which for me is 1000's.

Is there a way to have exif show only when requested?
pgowder is offline   Reply With Quote
Old September 23rd, 2007, 10:04 AM   #8 (permalink)
Photopost Developer
Verified Customer
 
Chuck S's Avatar
 
Join Date: Jun 2002
Location: Abingdon,MD
Posts: 68,069
How is the query timing though this is not really an issue that I see. If I view query timing it is non existant on my install. In pp-inc.php set $showsqldebug to 2 and post a link so we can see timimg.
__________________
Photopost Developer and Support Engineer

Please do not PM me for support or sales questions. Thank you for your understanding.
Chuck S is online now   Reply With Quote
Old September 23rd, 2007, 10:09 AM   #9 (permalink)
Member
Verified Customer
 
Join Date: Mar 2002
Posts: 496
Quote:
Originally Posted by Chuck S View Post
How is the query timing though this is not really an issue that I see. If I view query timing it is non existant on my install. In pp-inc.php set $showsqldebug to 2 and post a link so we can see timimg.
You can see it here:
http://www.powwows.com/galleries/sho...=17439&cat=506

But right now there is no load. I'm going to turn off debug in a minute and I'll revisit it tomorrow during heavy load.
pgowder is offline   Reply With Quote
Old September 23rd, 2007, 10:17 AM   #10 (permalink)
Photopost Developer
Verified Customer
 
Chuck S's Avatar
 
Join Date: Jun 2002
Location: Abingdon,MD
Posts: 68,069
Ok well you did not turn on query timing as instructed but anyway thats what I would initially look at. If any of the queries are returning slow results which hang a page.
__________________
Photopost Developer and Support Engineer

Please do not PM me for support or sales questions. Thank you for your understanding.
Chuck S is online now   Reply With Quote
Old September 23rd, 2007, 10:18 AM   #11 (permalink)
Member
Verified Customer
 
Join Date: Mar 2002
Posts: 496
Quote:
Originally Posted by Chuck S View Post
Ok well you did not turn on query timing as instructed but anyway thats what I would initially look at. If any of the queries are returning slow results which hang a page.
I did turn it on. And it shows a low number. But nobody is on the site right now.

What matters is how this affects other things during full load.
pgowder is offline   Reply With Quote
Old September 23rd, 2007, 10:18 AM   #12 (permalink)
Member
Verified Customer
 
Join Date: Mar 2002
Posts: 496
Quote:
Originally Posted by Chuck S View Post
Ok well you did not turn on query timing as instructed but anyway thats what I would initially look at. If any of the queries are returning slow results which hang a page.

And I know that this is a slow query because it is showing up in the slow query log!
pgowder is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Improved revenue Reporting for Classifieds skippy Classifieds Suggestions 0 January 10th, 2006 11:09 AM


All times are GMT -5. The time now is 08:46 AM.

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0