Subject Re: [firebird-support] Optimizing a subquery
Author Ann W. Harrison
kokok_kokok wrote:
> I need to do:
> select CustomerId, Sales, (select sum(Sales) from Customers) as Total
> from Customers
> It works fine, but for each row, Firebird executes the subquery
> "select sum(Sales) from Customers".

Are you sure? At one time, I'm quite sure that the compiler/optimizer
were good enough to remove loop invariants.