Skip to content
  • Steinar H. Gunderson's avatar
    08db920e
    WL #11590: More flexible filesort [patch 4/10, optimistic merge] · 08db920e
    Steinar H. Gunderson authored
    The merge phase of filesort may need room for as much as 15 rows, since
    we need one row for each chunk and there could be as many chunks.
    However, the current code is too pessimistic, refusing to make a sort if
    there exists a possible scenario where this could fail (ie., 15 rows
    of maximum possible size).
    
    This is too pessimistic; most merges have only seven merge chunks or
    fewer, and most rows are not maximum size. Thus, just assume we're fine,
    and give an error if we actually get into the situation where we don't
    have room for a merged row. This means we could potentially be doing
    wasted work before giving out the error, but it is much friendlier for
    the common case where we actually have enough merge buffer.
    
    Change-Id: Idd37075c85f618e6434eb034a5a4a271e170340d
    08db920e
    WL #11590: More flexible filesort [patch 4/10, optimistic merge]
    Steinar H. Gunderson authored
    The merge phase of filesort may need room for as much as 15 rows, since
    we need one row for each chunk and there could be as many chunks.
    However, the current code is too pessimistic, refusing to make a sort if
    there exists a possible scenario where this could fail (ie., 15 rows
    of maximum possible size).
    
    This is too pessimistic; most merges have only seven merge chunks or
    fewer, and most rows are not maximum size. Thus, just assume we're fine,
    and give an error if we actually get into the situation where we don't
    have room for a merged row. This means we could potentially be doing
    wasted work before giving out the error, but it is much friendlier for
    the common case where we actually have enough merge buffer.
    
    Change-Id: Idd37075c85f618e6434eb034a5a4a271e170340d
Loading