-
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
Steinar H. Gunderson authoredThe 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