View Single Post
Old 07-19-2011, 09:52 AM  
camperjohn64
Confirmed User
 
Industry Role:
Join Date: Feb 2005
Location: Los Angeles
Posts: 1,531
Another thing I was thinking this morning was having a fourth table with all the pre-calculated results:

Code:
table4:
  text html;
  int (1) category;
Then precalculate that table with the results of all possible joins from your original SELECT:

Code:
INSERT INTO table 4 (SELECT all possible ads blah blah)
Then just grab random ads from table4 based on category. No unions, no joins, no lookups, no nothing.

Every time you add or delete an affiliate or advertisement, you re-run the calculation for table 4 and re-populate it.
__________________
www.gimmiegirlproductions.com
camperjohn64 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote