postgresql/src/test
Alvaro Herrera 4e85642d93 Apply constraint exclusion more generally in partitioning
We were applying constraint exclusion on the partition constraint when
generating pruning steps for a clause, but only for the rather
restricted situation of them being boolean OR operators; however it is
possible to have differently shaped clauses that also benefit from
constraint exclusion.  This applies particularly to the default
partition since their constraints are in essence a long list of OR'ed
subclauses ... but it applies to other cases too.  So in certain cases
we're scanning partitions that we don't need to.

Remove the specialized code in OR clauses, and add a generally
applicable test of the clause refuting the partition constraint; mark
the whole pruning operation as contradictory if it hits.

This has the unwanted side-effect of testing some (most? all?)
constraints more than once if constraint_exclusion=on.  That seems
unavoidable as far as I can tell without some additional work, but
that's not the recommended setting for that parameter anyway.
However, because this imposes additional processing cost for all
queries using partitioned tables, I decided not to backpatch this
change.

Author: Amit Langote, Yuzuko Hosoya, Álvaro Herrera
Reviewers: Shawn Wang, Thibaut Madeleine, Yoshikazu Imai, Kyotaro
Horiguchi; they were also uncredited reviewers for commit 489247b0e6.
Discussion: https://postgr.es/m/9bb31dfe-b0d0-53f3-3ea6-e64b811424cf@lab.ntt.co.jp
2019-08-07 12:21:54 -04:00
..
authentication Update copyright for 2019 2019-01-02 12:44:25 -05:00
examples Update copyright for 2019 2019-01-02 12:44:25 -05:00
isolation Fix predicate-locking of HOT updated rows. 2019-08-07 12:40:49 +03:00
kerberos Save Kerberos and LDAP daemon logs where the buildfarm can find them. 2019-08-06 17:08:07 -04:00
ldap Save Kerberos and LDAP daemon logs where the buildfarm can find them. 2019-08-06 17:08:07 -04:00
locale Make sort-test.py Python 3 compatible 2019-01-04 11:23:24 +01:00
mb Fix MB regression tests for WAL-logging of hash indexes. 2017-03-15 07:25:36 -04:00
modules Move rolenames test out of the core regression tests. 2019-06-30 12:51:12 -04:00
perl Avoid picking already-bound TCP ports in kerberos and ldap test suites. 2019-08-04 13:07:12 -04:00
recovery Fix failure with pgperlcritic from the TAP test of synchronous replication 2019-07-25 07:55:23 +09:00
regress Apply constraint exclusion more generally in partitioning 2019-08-07 12:21:54 -04:00
ssl Initial pgperltidy run for v12. 2019-05-22 13:36:19 -04:00
subscription Initial pgperltidy run for v12. 2019-05-22 13:36:19 -04:00
thread Ensure link commands list *.o files before LDFLAGS. 2019-01-02 13:57:54 -05:00
Makefile Revert "Allow on-line enabling and disabling of data checksums" 2018-04-09 19:03:42 +02:00
README Add TAP tests for password-based authentication methods. 2017-03-17 11:34:16 +02:00

README

PostgreSQL tests
================

This directory contains a variety of test infrastructure as well as some of the
tests in PostgreSQL. Not all tests are here -- in particular, there are more in
individual contrib/ modules and in src/bin.

Not all these tests get run by "make check". Check src/test/Makefile to see
which tests get run automatically.

authentication/
  Tests for authentication

examples/
  Demonstration programs for libpq that double as regression tests via
  "make check"

isolation/
  Tests for concurrent behavior at the SQL level

locale/
  Sanity checks for locale data, encodings, etc

mb/
  Tests for multibyte encoding (UTF-8) support

modules/
  Extensions used only or mainly for test purposes, generally not suitable
  for installing in production databases

perl/
  Infrastructure for Perl-based TAP tests

recovery/
  Test suite for recovery and replication

regress/
  PostgreSQL's main regression test suite, pg_regress

ssl/
  Tests to exercise and verify SSL certificate handling

subscription/
  Tests for logical replication

thread/
  A thread-safety-testing utility used by configure