MySQL Forums
Forum List  »  Newbie

Re: Use of memory table vs temporary table question
Posted by: Jorge Torralba
Date: January 24, 2011 02:19PM

in detail, here is what I am doing and trying to improve upon.

A user searches a database of photos based on different search criteria. Sometimes his or her search could have 10 matches or 10000. This is not really an issue at this point in the user interaction. Since the resulting set of rows are not cached and are presented with pages of thumbnails. Each time the user moves to another page, another query is executed with a new off set and page limit. So in reality, the number of rows returned are minimal at 12.

The complexity and need for caching the entire results into a separate table is needed so that if a user clicks on a thumbnail from the original results as described above the user is then presented with the full view of the photograph. I then use the cached table with the thousands of rows in it to determine which is the next or previous photo with the same criteria based on original search. In other words, allow the user to browse all the photos that match the result set.

Here is the sites search page

http://nikonimages.com/showgallery.php?showall=1

By the way, the results table only has a sessionid, timestamp and photoid column. The user browses for photos based on the sessionid. The cron job deletes entries with timestamps older than 5 minutes.

Options: ReplyQuote


Subject
Written By
Posted
Re: Use of memory table vs temporary table question
January 24, 2011 02:19PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.