git.postgresql.org Git - postgresql.git/commit

git projects / postgresql.git / commit
? search:
summary | shortlog | log | commit | commitdiff | tree
(parent: 1fb57af) | patch
Build out the planner support function infrastructure.
Sat, 9 Feb 2019 23:32:23 +0000 (18:32 -0500)
Sat, 9 Feb 2019 23:32:23 +0000 (18:32 -0500)
commit a391ff3c3d418e404a2c6e4ff0865a107752827b
Build out the planner support function infrastructure.

Add support function requests for estimating the selectivity, cost,
and number of result rows (if a SRF) of the target function.

The lack of a way to estimate selectivity of a boolean-returning
function in WHERE has been a recognized deficiency of the planner
since Berkeley days. This commit finally fixes it.

In addition, non-constant estimates of cost and number of output
rows are now possible. We still fall back to looking at procost
and prorows if the support function doesn't service the request,
of course.

To make concrete use of the possibility of estimating output rowcount
for SRFs, this commit adds support functions for array_unnest(anyarray)
and the integer variants of generate_series; the lack of plausible
rowcount estimates for those, even when it's obvious to a human,
has been a repeated subject of complaints. Obviously, much more
could now be done in this line, but I'm mostly just trying to get
the infrastructure in place.

Discussion: https://postgr.es/m/15193.1548028093@sss.pgh.pa.us
27 files changed:
contrib/postgres_fdw/postgres_fdw.c diff | blob | blame | history
doc/src/sgml/xfunc.sgml diff | blob | blame | history
src/backend/optimizer/path/clausesel.c diff | blob | blame | history
src/backend/optimizer/path/costsize.c diff | blob | blame | history
src/backend/optimizer/util/clauses.c diff | blob | blame | history
src/backend/optimizer/util/pathnode.c diff | blob | blame | history
src/backend/optimizer/util/plancat.c diff | blob | blame | history
src/backend/utils/adt/arrayfuncs.c diff | blob | blame | history
src/backend/utils/adt/int.c diff | blob | blame | history
src/backend/utils/adt/int8.c diff | blob | blame | history
src/backend/utils/adt/selfuncs.c diff | blob | blame | history
src/backend/utils/cache/lsyscache.c diff | blob | blame | history
src/include/catalog/catversion.h diff | blob | blame | history
src/include/catalog/pg_proc.dat diff | blob | blame | history
src/include/nodes/nodes.h diff | blob | blame | history
src/include/nodes/pathnodes.h diff | blob | blame | history
src/include/nodes/supportnodes.h diff | blob | blame | history
src/include/optimizer/clauses.h diff | blob | blame | history
src/include/optimizer/plancat.h diff | blob | blame | history
src/include/utils/lsyscache.h diff | blob | blame | history
src/test/regress/expected/misc_functions.out diff | blob | blame | history
src/test/regress/expected/subselect.out diff | blob | blame | history
src/test/regress/input/create_function_1.source diff | blob | blame | history
src/test/regress/output/create_function_1.source diff | blob | blame | history
src/test/regress/regress.c diff | blob | blame | history
src/test/regress/sql/misc_functions.sql diff | blob | blame | history
src/test/regress/sql/subselect.sql diff | blob | blame | history
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /