Subject Re: [Firebird-Architect] Re: Some benchmarks about 'Order by' - temporary
Author Adriano dos Santos Fernandes
Arno Brinkman wrote:
> When does the merging (of multiple runs) happen? [By fetch, on first execute, ..?]
> Is the final merge only in memory or also written to disk?
When the sort RSE is open, it start sorting all records of the unsorted RSE.

If, at any record, the run is full, the run is written.

When some number of run was written, all these runs are merged and
written in one run, incrementing his
depth number.
Only runs (already merged) with depth < MAX_MERGE_LEVEL (2) are merged.

When all records was sorted, the last run is written, but a merge don't