View Single Post
Unread 11-13-2005, 06:54 PM   #63
Joe
The Pro/Life Support System
 
Joe's Avatar
 
Join Date: Dec 1999
Location: Denver, CO
Posts: 4,041
Default

ahh just fixed a bastard of a problem that has been killing the site re-design. it was slow as hell on initial queries- up to 15 seconds waiting on the DB to return a random value.

Turns out in MySQL using "ORDER BY RAND()" is very evil on large row length tables. I was running it on a table with 10,000 rows and it would just ass pound the system.

By offloading that logic to PHP and having it do the random picking of items, the total query takes .1 sec to run down from 15 seconds
__________________
Joe - I only take this hat off for one thing...

ProCooling archive curator and dusty skeleton.
Joe is offline   Reply With Quote