pg_plan_advice tracks two pieces of per-PlannerInfo data: (1) for each RTI, the corresponding relation identifier, for purposes of cross-checking those calculations against the final plan; and (2) the set of semijoins seen during planning for which the strategy of making one side unique was considered. The former is tracked using a hash table that uses <plan_name, RTI> as the key, and the latter is tracked using a List of <plan_name, relids>. It seems better to track both of these things in the same way and to try to reuse some code instead of having everything be completely separate, so invent pgpa_planner_info; we'll create one every time we see a new PlannerInfo and need to associate some data with it, and we'll use the plan_name field to distinguish between PlannerInfo objects, as it should always be unique. Then, refactor the two systems mentioned above to use this new infrastructure. (Note that the adjustment in pgpa_plan_walker is necessary in order to avoid spuriously triggering the sanity check in that function, in the case where a pgpa_planner_info is created for a purpose not related to sj_unique_rels.) Discussion: https://postgr.es/m/CA+TgmoaK=4w7-qknUo3QhUJ53pXZq=c=KgZmRyD+k7ytqfmgSg@mail.gmail.com Reviewed-by: Lukas Fittl <lukas@fittl.com> |
||
|---|---|---|
| .github | ||
| config | ||
| contrib | ||
| doc | ||
| src | ||
| .cirrus.star | ||
| .cirrus.tasks.yml | ||
| .cirrus.yml | ||
| .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/.