Sorting records are larger than really necessary [CORE4353] #4675
Labels
affect-version: 2.1.0
affect-version: 2.1.1
affect-version: 2.1.2
affect-version: 2.1.3
affect-version: 2.1.4
affect-version: 2.1.5 Update 1
affect-version: 2.1.5
affect-version: 2.5.0
affect-version: 2.5.1
affect-version: 2.5.2 Update 1
affect-version: 2.5.2
affect-version: 3.0 Alpha 1
affect-version: 3.0 Alpha 2
component: engine
fix-version: 2.5.3
fix-version: 3.0 Beta 1
priority: minor
qa: deferred
type: bug
Submitted by: @pavel-zotov
In external sorting (SORT plan), every record being sorted is stored as the sort key plus all the referenced fields plus stream-level information plus padding/alignment. However, the sorting record length is calculated inaccurately, causing redundant bytes to be allocated but never used. This causes the sort blocks to grow more than necessary thus slowing down the operation, especially when number of records being sorted is huge and sort blocks are swapped to disk. In most practical cases, this overhead is relatively small and is unlikely to be more than 5-10%, but in some artificial cases it could be up to 50%.
Commits: fd9f3ee d91fd2e FirebirdSQL/fbt-repository@990dba1 FirebirdSQL/fbt-repository@5416aab
====== Test Details ======
TODO // compare output of mon$memory_usage ?
The text was updated successfully, but these errors were encountered: