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 Bug Reports

Photopost Pro Bug Reports Post post installation PhotoPost Pro problems here.

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
Old January 25th, 2010, 10:44 PM   #1 (permalink)
Member
Verified Customer
 
Join Date: Aug 2006
Posts: 63
main gallery page - query sorting entire photos table

My gallery stats (which does take several minutes to load)
www.digishoptalk.com

Current Version 7.01
Registered Users 26,185
Comments/Ratings 6,946,951
Image Space Used 87,460.1 mb
Total Photos 823,614
Number of Albums 3980
Photos in Albums 100641
Posts in Albums 884582
ECards in Queue 0
Awaiting Approval 0
Total Views 29,766,770
Total disk space used by the DATA directory 102,524.94 mb


on my main gallery page (traditionally index.something) query number 12 basically looks at my entire photos table. Granted the query does limit to 33, but because the order by exists, sql orders the entire table and then returns the first 33 results.

Code:
Content visible to verified customers only.
the two items in the where clause probably won't make very good indexes because approved isn't going to vary very much, and I have nearly a 800k photos where storecat=0

Anything I can do?
DST Daddy is offline   Reply With Quote
Old January 26th, 2010, 05:53 AM   #2 (permalink)
Photopost Developer
Verified Customer
 
Chuck S's Avatar
 
Join Date: Jun 2002
Location: Abingdon,MD
Posts: 71,667
well not anything I could think of off the top of my head unless you further isolate the query. Meaning alter it to query only photos from a specific category blah blah blah.

I mean we have imposed a limit on the number of results actually returned which is the only thing we can do.

Basically the query above is saying return the newest 33 results

whats your actual query time. I mean here is a site that has one million photos its all about server setup when you get that big

Main Index - Trackpads Gallery
__________________
Photopost Developer and Support Engineer

Please do not PM me for support or sales questions. Thank you for your understanding.
Chuck S is offline   Reply With Quote
Old January 26th, 2010, 09:39 AM   #3 (permalink)
Member
Verified Customer
 
Join Date: Aug 2006
Posts: 63
What kind of server configuration would you suggest? we are running a 2 server setup, one web, and one database. Each machine is multi core, and 8 gigs of ram.

Trackpads does have a lot of photos, but their activity rate is much lower. We have 33 views per photo, they have 1.7 views per.

I have identified a few queries that are doing more then they probably need to do, can you please let me know what pages I might find these queries under? I watched the show full processlist in mysql for about 10 mins and have pulled in a few queries that seem to be taking a long time to run.

This one is pulling back all basically all photos in the gallery
Code:
Content visible to verified customers only.
again, pulling back all photos in the gallery
Code:
Content visible to verified customers only.
even with the limit directive applied on the above 2 queries, the database is still forced to work through all records before it can apply the limit.


Code:
Content visible to verified customers only.

I know that more recent versions of mysql support more advanced sql like subqueries... perhaps there could be some option to define the version of mysql that is being run and utilize some of the more advanced options in some of the queries.

thanks
DST Daddy is offline   Reply With Quote
Old January 26th, 2010, 11:47 AM   #4 (permalink)
Photopost Developer
Verified Customer
 
Chuck S's Avatar
 
Join Date: Jun 2002
Location: Abingdon,MD
Posts: 71,667
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.
__________________
Photopost Developer and Support Engineer

Please do not PM me for support or sales questions. Thank you for your understanding.
Chuck S is offline   Reply With Quote
Old January 26th, 2010, 08:47 PM   #5 (permalink)
Member
Verified Customer
 
Join Date: Aug 2006
Posts: 63
What would be the complications of only caching where cattype='c'?

I think a potential issue is that I have nearly 4000 categories, this makes the category cache really big... or the query to get all the categories and category properties is pretty hefty....
DST Daddy is offline   Reply With Quote
Old January 26th, 2010, 09:20 PM   #6 (permalink)
Photopost Developer
Verified Customer
 
Chuck S's Avatar
 
Join Date: Jun 2002
Location: Abingdon,MD
Posts: 71,667
The category cache in photopost does not contain any personal albums hense the cache is ONLY where cattype='c'
__________________
Photopost Developer and Support Engineer

Please do not PM me for support or sales questions. Thank you for your understanding.
Chuck S is offline   Reply With Quote
Old January 26th, 2010, 09:45 PM   #7 (permalink)
Member
Verified Customer
 
Join Date: Aug 2006
Posts: 63
if I SELECT * FROM `pp_categories` there are 4042 records returned...

my pp_cache catcache field starts out like this a:4052:{i:0;a:52:{i:0;s:4:"1818";s:2:"id";s:4:"181 and the catcache field is SUPER big
DST Daddy is offline   Reply With Quote
Old January 26th, 2010, 09:51 PM   #8 (permalink)
Member
Verified Customer
 
Join Date: Aug 2006
Posts: 63
if I add a "where cattype = 'c'" to the main query in the update_catcache() function my catcache starts out a:72 which is the same number that I get if I select count(*) from pp_categories where cattype = 'c'
DST Daddy is offline   Reply With Quote
Old January 27th, 2010, 07:59 AM   #9 (permalink)
Photopost Developer
Verified Customer
 
Chuck S's Avatar
 
Join Date: Jun 2002
Location: Abingdon,MD
Posts: 71,667
If you dont get any adverse actions then go for it but I would suppose here your photo and comment counts are not going to be the same etc etc because your not going to be including all those.
__________________
Photopost Developer and Support Engineer

Please do not PM me for support or sales questions. Thank you for your understanding.
Chuck S is offline   Reply With Quote
Old January 27th, 2010, 08:40 AM   #10 (permalink)
Member
Verified Customer
 
Join Date: Aug 2006
Posts: 63
So all categories (including user albums) were being cached?

Anything I can do to reduce the size of the cat props? cache?
DST Daddy is offline   Reply With Quote
Old January 27th, 2010, 10:00 AM   #11 (permalink)
Photopost Developer
Verified Customer
 
Chuck S's Avatar
 
Join Date: Jun 2002
Location: Abingdon,MD
Posts: 71,667
The category cache is something a user can turn on or off. I can be of a help or a detremtent to your site depending on how large it is etc etc.

I am merely saying to grab the proper counts etc that are shown on the cats block one needs to pass and access that information.

You can modify your code as you wish but I am just saying your category counts etc are not going to include data from those personal albums which may be relevant.

Personally I would just do some tests on load times with or without the cache and choose which one is faster.

PhotoPost Performance FAQ

Here was a faq Michael wrote up on this and things to turn on or off.
__________________
Photopost Developer and Support Engineer

Please do not PM me for support or sales questions. Thank you for your understanding.
Chuck S is offline   Reply With Quote
Old January 27th, 2010, 10:18 AM   #12 (permalink)
Member
Verified Customer
 
Join Date: Aug 2006
Posts: 63
thanks.... I've updated the code to not cache user albums, and load times are significantly faster. I believe it has to do with the query that pulls the cache from the DB. With the cache at 72 records vs 4000, the data can be returned to php much faster...
DST Daddy is offline   Reply With Quote
Old January 27th, 2010, 12:50 PM   #13 (permalink)
Photopost Developer
Verified Customer
 
Chuck S's Avatar
 
Join Date: Jun 2002
Location: Abingdon,MD
Posts: 71,667
Yep glad it works for you
__________________
Photopost Developer and Support Engineer

Please do not PM me for support or sales questions. Thank you for your understanding.
Chuck S 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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Entire Gallery - Photos not visible!.. no change to path.. Please help! alma townsend Photopost Pro How Do I...? 14 August 30th, 2007 01:57 PM
More than 9 photos per page / sorting NetDoc Photopost Pro Bug Reports 3 June 7th, 2007 05:23 PM
How to show Recent Photos only on the main Gallery page? gopherhockey Photopost Pro How Do I...? 3 October 15th, 2006 02:02 PM
Adding an html table to the main page? MitchSchaft ReviewPost How do I...? 1 August 12th, 2006 12:52 PM
Photos on Main Forum Page danny49 How Do I? - vBulletin 3.5.X 8 December 6th, 2005 12:03 PM


All times are GMT -5. The time now is 11:21 PM.

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