Welcome Guest, Not a member yet? Register   Sign In
0.5s query takes 13s to run 4 times
#3

[eluser]WanWizard[/eluser]
What database engine is used? How big is this table? What platform are you running this on (hosting, dedicated server, local on a laptop, ...)?

If MySQL, run
Code:
EXPLAIN EXTENDED SELECT AVG(price) as price, week from globalhistory where product_id = 1 and week > 1098421200 GROUP BY week

And check if it uses the proper indexes.


Messages In This Thread
0.5s query takes 13s to run 4 times - by El Forum - 08-06-2010, 12:38 AM
0.5s query takes 13s to run 4 times - by El Forum - 08-06-2010, 01:00 AM
0.5s query takes 13s to run 4 times - by El Forum - 08-06-2010, 01:51 AM
0.5s query takes 13s to run 4 times - by El Forum - 08-06-2010, 02:16 AM
0.5s query takes 13s to run 4 times - by El Forum - 08-06-2010, 03:31 AM
0.5s query takes 13s to run 4 times - by El Forum - 08-09-2010, 03:49 AM



Theme © iAndrew 2016 - Forum software by © MyBB