View Single Post
Old September 23rd, 2007, 09:05 AM   #5 (permalink)
pgowder
Member
Verified Customer
 
Join Date: Mar 2002
Posts: 499
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