-
Steinar H. Gunderson authored
Bug #29660945: SIG 6 AT TEMPTABLE::HANDLER::POSITION | SRC/HANDLER.CC There are certain cases where we currently materialize, but don't need to: - If doing a sort at the end of a join (e.g. for grouping), and we don't sort by row IDs, we can just stream the data directly from the correct iterator into the SortingIterator. (This is now possible to know, since after the fix for #29595346, we know when creating the SortingIterator whether it will be by row IDs or not.) - If materializing a derived table that we don't intend to read from multiple times, and would only table scan. Fix both cases by means of a new StreamingIterator that does the required copying of fields and nothing else. Note that since we now decide ahead-of-time whether we want to sort by row IDs or not, we have somewhat less information; we don't necessarily know the number of rows to sort (used for priority queue decisions), and there are a few cases where it would be slightly better to sort by row ID that we now do not. The benefits from the more common cases should be more than enough to offset this. Re-submit with fix for #29660945: Stop stripping off addon fields at sorting time to get a bigger chance of using the priority queue. Change-Id: I5f187ed60d1b974b940c5dc614fe9b0bb3a87d51
Steinar H. Gunderson authoredBug #29660945: SIG 6 AT TEMPTABLE::HANDLER::POSITION | SRC/HANDLER.CC There are certain cases where we currently materialize, but don't need to: - If doing a sort at the end of a join (e.g. for grouping), and we don't sort by row IDs, we can just stream the data directly from the correct iterator into the SortingIterator. (This is now possible to know, since after the fix for #29595346, we know when creating the SortingIterator whether it will be by row IDs or not.) - If materializing a derived table that we don't intend to read from multiple times, and would only table scan. Fix both cases by means of a new StreamingIterator that does the required copying of fields and nothing else. Note that since we now decide ahead-of-time whether we want to sort by row IDs or not, we have somewhat less information; we don't necessarily know the number of rows to sort (used for priority queue decisions), and there are a few cases where it would be slightly better to sort by row ID that we now do not. The benefits from the more common cases should be more than enough to offset this. Re-submit with fix for #29660945: Stop stripping off addon fields at sorting time to get a bigger chance of using the priority queue. Change-Id: I5f187ed60d1b974b940c5dc614fe9b0bb3a87d51
Loading