On 2020-01-24 14:39, Dimitry Sibiryakov s...@ibphoenix.com [firebird-support] wrote: > 24.01.2020 14:29, Matthias Winkler spmm...@gmail.com [firebird-support] > wrote: >> I see the very same issue with firebird 3.0.4. Any ideas? > > You made nested loop on 18000*18000 records with sorting on each > itaretion. It cannot > be fast.
It sounds to me like this is should be optimized by executing the uncorrelated sub-queries only once. Mark