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

git projects / postgresql.git / commit
? search:
summary | shortlog | log | commit | commitdiff | tree
(parent: b26e3d6) | patch
Redesign tablesample method API, and do extensive code review.
2015年7月25日 18:39:00 +0000 (14:39 -0400)
2015年7月25日 18:39:00 +0000 (14:39 -0400)
commit dd7a8f66ed278eef2f001a98e2312336c61ee527
Redesign tablesample method API, and do extensive code review.

The original implementation of TABLESAMPLE modeled the tablesample method
API on index access methods, which wasn't a good choice because, without
specialized DDL commands, there's no way to build an extension that can
implement a TSM. (Raw inserts into system catalogs are not an acceptable
thing to do, because we can't undo them during DROP EXTENSION, nor will
pg_upgrade behave sanely.) Instead adopt an API more like procedural
language handlers or foreign data wrappers, wherein the only SQL-level
support object needed is a single handler function identified by having
a special return type. This lets us get rid of the supporting catalog
altogether, so that no custom DDL support is needed for the feature.

Adjust the API so that it can support non-constant tablesample arguments
(the original coding assumed we could evaluate the argument expressions at
ExecInitSampleScan time, which is undesirable even if it weren't outright
unsafe), and discourage sampling methods from looking at invisible tuples.
Make sure that the BERNOULLI and SYSTEM methods are genuinely repeatable
within and across queries, as required by the SQL standard, and deal more
honestly with methods that can't support that requirement.

Make a full code-review pass over the tablesample additions, and fix
assorted bugs, omissions, infelicities, and cosmetic issues (such as
failure to put the added code stanzas in a consistent ordering).
Improve EXPLAIN's output of tablesample plans, too.

Back-patch to 9.5 so that we don't have to support the original API
in production.
83 files changed:
contrib/pg_stat_statements/pg_stat_statements.c diff | blob | blame | history
contrib/tsm_system_rows/Makefile diff | blob | blame | history
contrib/tsm_system_rows/expected/tsm_system_rows.out diff | blob | blame | history
contrib/tsm_system_rows/sql/tsm_system_rows.sql diff | blob | blame | history
contrib/tsm_system_rows/tsm_system_rows--1.0.sql diff | blob | blame | history
contrib/tsm_system_rows/tsm_system_rows.c diff | blob | blame | history
contrib/tsm_system_rows/tsm_system_rows.control diff | blob | blame | history
contrib/tsm_system_time/Makefile diff | blob | blame | history
contrib/tsm_system_time/expected/tsm_system_time.out diff | blob | blame | history
contrib/tsm_system_time/sql/tsm_system_time.sql diff | blob | blame | history
contrib/tsm_system_time/tsm_system_time--1.0.sql diff | blob | blame | history
contrib/tsm_system_time/tsm_system_time.c diff | blob | blame | history
contrib/tsm_system_time/tsm_system_time.control diff | blob | blame | history
doc/src/sgml/catalogs.sgml diff | blob | blame | history
doc/src/sgml/datatype.sgml diff | blob | blame | history
doc/src/sgml/postgres.sgml diff | blob | blame | history
doc/src/sgml/ref/select.sgml diff | blob | blame | history
doc/src/sgml/tablesample-method.sgml diff | blob | blame | history
doc/src/sgml/tsm-system-rows.sgml diff | blob | blame | history
doc/src/sgml/tsm-system-time.sgml diff | blob | blame | history
src/backend/access/heap/heapam.c diff | blob | blame | history
src/backend/access/tablesample/Makefile diff | blob | blame | history
src/backend/access/tablesample/bernoulli.c diff | blob | blame | history
src/backend/access/tablesample/system.c diff | blob | blame | history
src/backend/access/tablesample/tablesample.c diff | blob | blame | history
src/backend/catalog/Makefile diff | blob | blame | history
src/backend/catalog/dependency.c diff | blob | blame | history
src/backend/commands/explain.c diff | blob | blame | history
src/backend/executor/execAmi.c diff | blob | blame | history
src/backend/executor/nodeSamplescan.c diff | blob | blame | history
src/backend/nodes/copyfuncs.c diff | blob | blame | history
src/backend/nodes/equalfuncs.c diff | blob | blame | history
src/backend/nodes/nodeFuncs.c diff | blob | blame | history
src/backend/nodes/outfuncs.c diff | blob | blame | history
src/backend/nodes/readfuncs.c diff | blob | blame | history
src/backend/optimizer/path/allpaths.c diff | blob | blame | history
src/backend/optimizer/path/costsize.c diff | blob | blame | history
src/backend/optimizer/plan/createplan.c diff | blob | blame | history
src/backend/optimizer/plan/initsplan.c diff | blob | blame | history
src/backend/optimizer/plan/planner.c diff | blob | blame | history
src/backend/optimizer/plan/setrefs.c diff | blob | blame | history
src/backend/optimizer/plan/subselect.c diff | blob | blame | history
src/backend/optimizer/prep/prepjointree.c diff | blob | blame | history
src/backend/optimizer/util/pathnode.c diff | blob | blame | history
src/backend/parser/gram.y diff | blob | blame | history
src/backend/parser/parse_clause.c diff | blob | blame | history
src/backend/parser/parse_func.c diff | blob | blame | history
src/backend/rewrite/rewriteHandler.c diff | blob | blame | history
src/backend/utils/adt/pseudotypes.c diff | blob | blame | history
src/backend/utils/adt/ruleutils.c diff | blob | blame | history
src/backend/utils/cache/lsyscache.c diff | blob | blame | history
src/backend/utils/cache/syscache.c diff | blob | blame | history
src/backend/utils/errcodes.txt diff | blob | blame | history
src/backend/utils/misc/sampling.c diff | blob | blame | history
src/bin/psql/tab-complete.c diff | blob | blame | history
src/include/access/heapam.h diff | blob | blame | history
src/include/access/tablesample.h [deleted file] blob | blame | history
src/include/access/tsmapi.h [new file with mode: 0644] blob
src/include/catalog/catversion.h diff | blob | blame | history
src/include/catalog/indexing.h diff | blob | blame | history
src/include/catalog/pg_proc.h diff | blob | blame | history
src/include/catalog/pg_tablesample_method.h [deleted file] blob | blame | history
src/include/catalog/pg_type.h diff | blob | blame | history
src/include/executor/nodeSamplescan.h diff | blob | blame | history
src/include/nodes/execnodes.h diff | blob | blame | history
src/include/nodes/nodes.h diff | blob | blame | history
src/include/nodes/parsenodes.h diff | blob | blame | history
src/include/nodes/plannodes.h diff | blob | blame | history
src/include/optimizer/cost.h diff | blob | blame | history
src/include/parser/parse_func.h diff | blob | blame | history
src/include/port.h diff | blob | blame | history
src/include/utils/builtins.h diff | blob | blame | history
src/include/utils/lsyscache.h diff | blob | blame | history
src/include/utils/syscache.h diff | blob | blame | history
src/port/erand48.c diff | blob | blame | history
src/test/regress/expected/rowsecurity.out diff | blob | blame | history
src/test/regress/expected/rules.out diff | blob | blame | history
src/test/regress/expected/sanity_check.out diff | blob | blame | history
src/test/regress/expected/tablesample.out diff | blob | blame | history
src/test/regress/output/misc.source diff | blob | blame | history
src/test/regress/serial_schedule diff | blob | blame | history
src/test/regress/sql/rowsecurity.sql diff | blob | blame | history
src/test/regress/sql/tablesample.sql diff | blob | blame | history
This is the main PostgreSQL git repository.
RSS Atom

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