You are here:  »  Taken down server

Support Forum



Taken down server

Submitted by Doug on Tue, 2007-05-22 17:16 in

Two server have disabled my datebase because of code I've added, see there reply:

Particular problem query appears to be:

index.php: $sql = "SELECT * FROM
`".$config_databaseTablePrefix."products` ORDER BY RAND() LIMIT 4";

It causes a full table scan instead of being clever and using indexes.

I think I had this code in footer.php
Just thought I'd warn other that my get same problem
Doug

Submitted by support on Thu, 2007-05-24 12:25

Hi Doug,

Thanks for the headsup - I can see why that could be an issue on large sites. Random product selection is a popular request so i'll have a look into more efficient ways of doing this...

Cheers,
David.