Welcome Guest, Not a member yet? Register   Sign In
Your opinion about this query .
#2

[eluser]richthegeek[/eluser]
0.0298 on 174,792 rows is good.

Selection on an indexed column is O(log n), on an unindexed is O(n) or as it seems to presort the column, O(n log n), so the bulk of the cost (174,792 of about 175,000) is from searching the "status" column in the "users" table. If you add "status" to the indexed list you can cut the query cost from about 175,000 to about 50.

tl;dr: your query is fine, index the users.status column.


Messages In This Thread
Your opinion about this query . - by El Forum - 02-14-2010, 01:55 PM
Your opinion about this query . - by El Forum - 02-14-2010, 03:05 PM
Your opinion about this query . - by El Forum - 02-14-2010, 03:45 PM
Your opinion about this query . - by El Forum - 02-14-2010, 03:53 PM
Your opinion about this query . - by El Forum - 02-14-2010, 04:23 PM
Your opinion about this query . - by El Forum - 02-14-2010, 11:59 PM



Theme © iAndrew 2016 - Forum software by © MyBB