The first query is in showgallery however we dont specifically query showgallery like that. That query would come from running showgallery.php without a category variable. There is no active link in our latest code that does that.
Second query showphoto or showframe the next previous images you can turn those off. I beleive that is listed under the performance FAQ in the faq forum
I dont know why you posted the third query thats your category query in pp-inc.php to grab all your categories and info.
This comes down to a more precise conversation on mysql and how it works not so much with the queries. We place options to turn something on or off. For example as I previous talked about the recent photos. We can place a limit so not all results are printed that is good. However that query has no specific limits because of how its designed.
Quote:
SELECT id,user,userid,cat,storecat,title,ismature,bigimage,height,width FROM pp_photos WHERE approved=1 AND storecat=0 ORDER BY date DESC LIMIT 33 |
There are VERY FEW queries that have to do a full table scan. The only ones I know of are the recent photos or next previous image previews. Anything else is very specific in the info returned. Both of these options can be turned off. The problem the for instance the recent photos. You want to show the latest 8 images. So we query for say 33 to limit the results which saves some processing time but you still need to scan the table. The problem is with that specific feature and what it is suppose to do there is nothing to really limit the query.
its not like your going to say WHERE cat=501 and userid=2 in that query because that sure would limit the scan but at the same time it would not return the latest 8 true photos uploaded to your gallery.
I wish there was a way to really optimize certain things but we really put on off switches for a reason as some things will have a higher load.
I have been doing alot of reading on mysql optimization and its limitations. If at all possible you want to refine queries to be very very specific but some functionalities in the program you can not be specific.