This is something i did try  But only recently found some bad queries
For example: ( using * )
SELECT DISTINCT * from visitorips where siteid = '$siteid' order by id desc limit 30
Takes about 1second to execute. ( Edit: Sorry i mean 5secs.. )
HOWEVER!
If i change the where from = to "like"
SELECT DISTINCT * from visitorips where siteid LIKE '$siteid' order by id desc limit 30
It states it takes 0.00 seconds and works fine.
( I then have some PHP code that checks the siteids "really" match after.
This has increased performance by like 700%
I suppose i should change it from * to the fields..
Last edited by lynxus; 02-06-2011 at 06:20 AM..
|