Add more tests for hashing and hash-based plans
authorPeter Eisentraut <peter@eisentraut.org>
Wed, 18 Nov 2020 06:58:37 +0000 (07:58 +0100)
committerPeter Eisentraut <peter@eisentraut.org>
Wed, 18 Nov 2020 07:29:50 +0000 (08:29 +0100)
commit6dd8b00807871bfd0c3ce8e18fd1f6ba1a71fbf9
tree33b0098c619430ef288331fa637c442899bbb8b7
parentbf0aa7c4b83bcf3116c5a3c191bbc677ab3beb59
Add more tests for hashing and hash-based plans

- Test hashing of an array of a non-hashable element type.

- Test UNION [DISTINCT] with hash- and sort-based plans.  (Previously,
  only INTERSECT and EXCEPT where tested there.)

- Test UNION [DISTINCT] with a non-hashable column type.  This
  currently reverts to a sort-based plan even if enable_hashagg is on.

- Test UNION/INTERSECT/EXCEPT hash- and sort-based plans with arrays
  as column types.  Also test an array with a non-hashable element
  type.

- Test UNION/INTERSECT/EXCEPT similarly with row types as column
  types.  Currently, this uses only sort-based plans because there is
  no hashing support for row types.

- Add a test case that shows that recursive queries using UNION
  [DISTINCT] require hashable column types.

- Add a currently failing test that uses UNION DISTINCT in a
  cycle-detection use case using row types as column types.

Discussion: https://www.postgresql.org/message-id/flat/38eccd35-4e2d-6767-1b3c-dada1eac3124%402ndquadrant.com
src/test/regress/expected/hash_func.out
src/test/regress/expected/union.out
src/test/regress/expected/with.out
src/test/regress/sql/hash_func.sql
src/test/regress/sql/union.sql
src/test/regress/sql/with.sql