Обсуждение: pgsql: Add a regression test case to improve code coverage for tuplesor

Поиск
Список
Период
Сортировка

pgsql: Add a regression test case to improve code coverage for tuplesor

От
Tom Lane
Дата:
Add a regression test case to improve code coverage for tuplesort.

Test the external-sort code path in CLUSTER for two different scenarios:
multiple-pass external sorting, and the best case for replacement
selection, where only one run is produced, so that no merge is required.
This test would have caught the bug fixed in commit 1b0fc8507, at
least when run with valgrind enabled.

In passing, add a short-circuit test in plan_cluster_use_sort() to make
dead certain that it selects sorting when enable_indexscan is off.  As
things stand, that would happen anyway, but it seems like good future
proofing for this test.

Peter Geoghegan

Discussion: <CAM3SWZSgxehDkDMq1FdiW2A0Dxc79wH0hz1x-TnGy=1BXEL+nw@mail.gmail.com>

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/cec55013943d160538334ee19ef5db429a085969

Modified Files
--------------
src/backend/optimizer/plan/planner.c  |  4 ++++
src/test/regress/expected/cluster.out | 36 +++++++++++++++++++++++++++++++++++
src/test/regress/sql/cluster.sql      | 34 +++++++++++++++++++++++++++++++++
3 files changed, 74 insertions(+)