When fixing up the targetlist and qpqual of an outer join, we must account for the effects of the outer join. Vars and PHVs appearing there are logically above the join, so they should have nullingrels equal to the input Vars/PHVs' nullingrels plus the bit added by the outer join. Determining the effects of the outer join can be tricky when the join has been commuted with another one per outer join identity 3. In this case, the Vars/PHVs in the join's targetlist and qpqual should have the same nullingrels that they would if the two joins had been done in syntactic order. Unfortunately, in setrefs.c, we don't have enough information to identify what that should be, so we have to use superset nullingrels matches instead of exact ones. However, we can tighten the check somewhat. Currently, we check whether the jointype is JOIN_INNER and use NRM_SUPERSET if it is not. We can improve this by checking whether the Join node has non-empty ojrelids and using NRM_SUPERSET only in that case. This allows us to perform exact matches in more situations. To support this, we record the outer-join relids in Join plan nodes. This information can also improve EXPLAIN (RANGE_TABLE) output by showing which outer-join relids are completed by each Join plan node. We may discover additional uses for this information in the future. Author: Richard Guo <guofenglinux@gmail.com> Discussion: https://postgr.es/m/CAMbWs482_DFHzQ079ZPp6c8UvmFdz3Jj+4K8tVRu9g2Bw34NPA@mail.gmail.com |
||
|---|---|---|
| .github | ||
| config | ||
| contrib | ||
| doc | ||
| src | ||
| .dir-locals.el | ||
| .editorconfig | ||
| .git-blame-ignore-revs | ||
| .gitattributes | ||
| .gitignore | ||
| .mailmap | ||
| aclocal.m4 | ||
| configure | ||
| configure.ac | ||
| COPYRIGHT | ||
| GNUmakefile.in | ||
| HISTORY | ||
| Makefile | ||
| meson.build | ||
| meson_options.txt | ||
| README.md | ||
PostgreSQL Database Management System
This directory contains the source code distribution of the PostgreSQL database management system.
PostgreSQL is an advanced object-relational database management system that supports an extended subset of the SQL standard, including transactions, foreign keys, subqueries, triggers, user-defined types and functions. This distribution also contains C language bindings.
Copyright and license information can be found in the file COPYRIGHT.
General documentation about this version of PostgreSQL can be found at https://www.postgresql.org/docs/devel/. In particular, information about building PostgreSQL from the source code can be found at https://www.postgresql.org/docs/devel/installation.html.
The latest version of this software, and related software, may be obtained at https://www.postgresql.org/download/. For more information look at our web site located at https://www.postgresql.org/.