Re: How do you like this SQL?
From: Mladen Gogala <gogala.mladen_at_gmail.com>
Date: Fri, 14 Dec 2012 11:15:46 +0000 (UTC)
Message-ID: <kaf1p2$1hp$8_at_solani.org>
On Fri, 14 Dec 2012 02:17:41 -0800, dombrooks wrote:
Date: Fri, 14 Dec 2012 11:15:46 +0000 (UTC)
Message-ID: <kaf1p2$1hp$8_at_solani.org>
On Fri, 14 Dec 2012 02:17:41 -0800, dombrooks wrote:
> It's very hard to condemn a snippet of SQL.
Well, not always.
>
> But whether it is sensible/desirable to do these lookups as a forced
> nested loop equivalent depends on the bigger picture.
Dom, the comment about the unusual and cruel punishment was made because the model is obviously messed up. Whenever there is a very big table which needs counting records of certain type, there is a table missing. Second, one could use analytic functions in the subquery, which would probably be much faster.
-- http://mgogala.byethost5.comReceived on Fri Dec 14 2012 - 12:15:46 CET