|
|
> So I take it using SELECT DISTINCT X ... is better than using SELECT X ...
> GROUP BY X for what I want to do?
OK, so this is weird.
When I call COUNT(*) FROM (SELECT X ... GROUP BY X) on my test data set
(about 100k eventID rows) it runs in 0.25s. That's a bit slow, but hmm ok.
If I change the SQL statement to COUNT(*) FROM (SELECT DISTINCT X ... ) it
takes 11.27s. Huh?
Also, with the DISTINCT method, as I repeatedly execute the query the
database size seems to have grown from 7MB to 14MB then to 31MB... HUH? The
database size goes up by 4x just by executing a query a few times? Maybe
it's optimising something for future queries, but it doesn't seem to get any
faster the 2nd or 3rd time...
Post a reply to this message
|
|