13.08.2013 11:55, Dimitry Sibiryakov wrote: > > Because plans are read from bottom to the top, I would prefer something like > this: > > (A) > > Select Expression > -> Aggregate > -> Sort (unique) > -> Table "RDB$RELATIONS" Access By ID > -> Index "RDB$INDEX_0" Scan
Now imagine two aggregate functions with DISTINCT inside: Select Expression -> Aggregate -> Sort (unique) -> Sort (unique) -> Table "RDB$RELATIONS" Access By ID -> Index "RDB$INDEX_0" Scan Is it understandable that sorts are independent from each other but both dependent from the retrieval? I don't think so. Dmitry ------------------------------------------------------------------------------ Get 100% visibility into Java/.NET code with AppDynamics Lite! It's a free troubleshooting tool designed for production. Get down to code-level detail for bottlenecks, with <2% overhead. Download for free and get started troubleshooting in minutes. http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk Firebird-Devel mailing list, web interface at https://lists.sourceforge.net/lists/listinfo/firebird-devel