Subject Re: [IBO] Running total column
Author Eyal
--- In, Robert martin <rob@c...> wrote:
> Hi Eyal
> I don't know if this is a dumb idea or not, but couldn't you change
> query to something like...
> Select pk, Date, Desc, Amount (Select Sum(Amount) FROM xx Where pk <
> FROM xx yy;
> Seems like a slow way to do it but it would be simple and OK for
> data sets.


Thanks for the reply.

The idea certainly isn't dumb. It should work just fine, but as you
noted it's slow for data sets that aren't small. The efficiency is
O(n^2) compared to O(1) of a "normal" query.

Of course caching and other optimizations can mitigate some of the
effect, but still the query is noticably slower with big datasets.