PhotoPost Photo Gallery Sales PhotoPost Sales Toll Free Phone Number
Mon-Fri 9am-4pm EST
  PhotoPost Photo Sharing Photo Gallery    Visualize community tm
| | | | | | | | |
Old September 17th, 2008, 05:20 AM   #1 (permalink)
Member
 
Join Date: Jun 2004
Posts: 164
Missing index on ppgal_favorites

Table ppgal_favorites is missing an index on userid, which causes full table scans when viewing a member profile.
Kirby is offline   Reply With Quote
Old September 17th, 2008, 05:30 AM   #2 (permalink)
Photopost Developer
Verified Customer
 
Chuck S's Avatar
 
Join Date: Jun 2002
Location: Abingdon,MD
Posts: 71,664
Thanks not really a true bug but will have a look.
__________________
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 18th, 2008, 05:04 AM   #3 (permalink)
Registered User
 
Join Date: Aug 2005
Posts: 1,229
@chuck or zach
if you are going to add an index..
please also add while your at it a datestamp field.. so we can order favorites by date.. asc and desc etc...
Luc
Luciano is offline   Reply With Quote
Old September 18th, 2008, 05:59 AM   #4 (permalink)
Photopost Developer
Verified Customer
 
Chuck S's Avatar
 
Join Date: Jun 2002
Location: Abingdon,MD
Posts: 71,664
There is already an index present on the images table for field dateline Luciano
__________________
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 18th, 2008, 06:57 AM   #5 (permalink)
Registered User
 
Join Date: Aug 2005
Posts: 1,229
sorry,
english is not my mother tongue...
and.. i was to quick..

but what i meant was:
if you are going to change something in favourite table.. while you are at it.. you could add a dateline field for favorites..

so you can know when user added image to his favorites

this would allow to pull favorites for example in profile.. (show latest favorites of user .. etc.. etc.. or order favorites by addition date etc..)

Luc

Last edited by Luciano; September 18th, 2008 at 07:06 AM.
Luciano is offline   Reply With Quote
Old September 18th, 2008, 06:01 PM   #6 (permalink)
Photopost Developer
Verified Customer
 
Chuck S's Avatar
 
Join Date: Jun 2002
Location: Abingdon,MD
Posts: 71,664
well just a note the sorts are all done on the images table so sort by date is already indexed from what I show.

There is not date field in favorites only userid and imageid
__________________
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 19th, 2008, 12:44 AM   #7 (permalink)
Registered User
 
Join Date: Aug 2005
Posts: 1,229
I know that...

it was a sugestion only..

because in my install.. I added a date field.. and in userprofile i pull the users favorites.. the last 3 he added.. (if he added some)
works fine in my test install..but needs the extra field.
So my thinking was...
If you were going to change someting in that table anyway.. why not add that date field... (just a suggestion.. not important enough to open an own thread)

then i could post the mod once its finished and I would not have to add the field in my mod.. (because I hate tampering with databases when writing a mod)
that was all .. (didnt mean to highjack this thread..)

Luc
Luciano is offline   Reply With Quote
Old September 19th, 2008, 09:45 AM   #8 (permalink)
Photopost Developer
Verified Customer
 
Chuck S's Avatar
 
Join Date: Jun 2002
Location: Abingdon,MD
Posts: 71,664


Okay so you where doing a mod now I know where your coming from because I knew there was no functionality like that.
__________________
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 December 25th, 2008, 07:46 PM   #9 (permalink)
Junior Member
Verified Customer
 
Join Date: May 2008
Location: London, UK
Posts: 8
Hey Chuck,

I'd classify this (Kirby's original bug report) as a performance bug; especially for sites that make heavy use of the favorites functionality.

ppgal_favorites.userid is joined/filtered upon in misc.php and showimage.php.

Note: I'm using vbG v2.4.3.

In the meantime, I've done the following for my site:

mysql> alter table vb_ppgal_favorites add foreign key (userid) references vb_user (userid) on delete cascade;

Cheers,
Dave.
dfidler 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
gallery index load as domain main index sabrina Photopost Pro How Do I...? 1 October 15th, 2007 07:18 PM
Index missing for 'approved' column? bajabob Photopost Pro Bug Reports 16 September 10th, 2007 07:17 PM
index.html redirect to index.php JoeWho Photopost Pro How Do I...? 2 February 20th, 2007 12:40 PM
Make the gallery index appear on the forums index? Xil Ze How Do I? - vBulletin 3.0.X 5 June 21st, 2005 05:52 AM
After install, no user text on index.php or adm-index.php silknet01 Classifieds Installation & Upgrades 6 April 14th, 2005 01:43 PM


All times are GMT -5. The time now is 05:09 PM.

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