POV-Ray : Newsgroups : povray.off-topic : SQL question : Re: SQL question Server Time
29 Sep 2024 15:26:38 EDT (-0400)
  Re: SQL question  
From: scott
Date: 12 Mar 2009 06:29:35
Message: <49b8e40f$1@news.povray.org>
> 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

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.