1996-07-09 08:22:35 +02:00
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
*
|
1999-02-14 00:22:53 +01:00
|
|
|
* cost.h
|
1996-07-09 08:22:35 +02:00
|
|
|
* prototypes for costsize.c and clausesel.c.
|
|
|
|
*
|
|
|
|
*
|
2022-01-08 01:04:57 +01:00
|
|
|
* Portions Copyright (c) 1996-2022, PostgreSQL Global Development Group
|
2000-01-26 06:58:53 +01:00
|
|
|
* Portions Copyright (c) 1994, Regents of the University of California
|
1996-07-09 08:22:35 +02:00
|
|
|
*
|
2010-09-20 22:08:53 +02:00
|
|
|
* src/include/optimizer/cost.h
|
1996-07-09 08:22:35 +02:00
|
|
|
*
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
*/
|
|
|
|
#ifndef COST_H
|
|
|
|
#define COST_H
|
|
|
|
|
2019-01-29 22:49:25 +01:00
|
|
|
#include "nodes/pathnodes.h"
|
2002-11-21 01:42:20 +01:00
|
|
|
#include "nodes/plannodes.h"
|
1997-11-26 02:14:33 +01:00
|
|
|
|
2002-11-21 01:42:20 +01:00
|
|
|
|
2000-01-23 03:07:00 +01:00
|
|
|
/* defaults for costsize.c's Cost parameters */
|
2000-02-15 21:49:31 +01:00
|
|
|
/* NB: cost-estimation code should use the variables, not these constants! */
|
2020-11-30 04:54:31 +01:00
|
|
|
/* If you change these, update backend/utils/misc/postgresql.conf.sample */
|
2006-06-05 04:49:58 +02:00
|
|
|
#define DEFAULT_SEQ_PAGE_COST 1.0
|
2000-02-15 21:49:31 +01:00
|
|
|
#define DEFAULT_RANDOM_PAGE_COST 4.0
|
|
|
|
#define DEFAULT_CPU_TUPLE_COST 0.01
|
2006-06-05 05:03:42 +02:00
|
|
|
#define DEFAULT_CPU_INDEX_TUPLE_COST 0.005
|
2000-02-15 21:49:31 +01:00
|
|
|
#define DEFAULT_CPU_OPERATOR_COST 0.0025
|
Add a Gather executor node.
A Gather executor node runs any number of copies of a plan in an equal
number of workers and merges all of the results into a single tuple
stream. It can also run the plan itself, if the workers are
unavailable or haven't started up yet. It is intended to work with
the Partial Seq Scan node which will be added in future commits.
It could also be used to implement parallel query of a different sort
by itself, without help from Partial Seq Scan, if the single_copy mode
is used. In that mode, a worker executes the plan, and the parallel
leader does not, merely collecting the worker's results. So, a Gather
node could be inserted into a plan to split the execution of that plan
across two processes. Nested Gather nodes aren't currently supported,
but we might want to add support for that in the future.
There's nothing in the planner to actually generate Gather nodes yet,
so it's not quite time to break out the champagne. But we're getting
close.
Amit Kapila. Some designs suggestions were provided by me, and I also
reviewed the patch. Single-copy mode, documentation, and other minor
changes also by me.
2015-10-01 01:23:36 +02:00
|
|
|
#define DEFAULT_PARALLEL_TUPLE_COST 0.1
|
|
|
|
#define DEFAULT_PARALLEL_SETUP_COST 1000.0
|
2000-01-23 03:07:00 +01:00
|
|
|
|
2022-03-24 16:47:41 +01:00
|
|
|
/* defaults for non-Cost parameters */
|
|
|
|
#define DEFAULT_RECURSIVE_WORKTABLE_FACTOR 10.0
|
2014-05-09 03:11:47 +02:00
|
|
|
#define DEFAULT_EFFECTIVE_CACHE_SIZE 524288 /* measured in pages */
|
2014-05-09 02:49:38 +02:00
|
|
|
|
2009-01-07 23:40:49 +01:00
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
CONSTRAINT_EXCLUSION_OFF, /* do not use c_e */
|
|
|
|
CONSTRAINT_EXCLUSION_ON, /* apply c_e to all rels */
|
|
|
|
CONSTRAINT_EXCLUSION_PARTITION /* apply c_e to otherrels only */
|
|
|
|
} ConstraintExclusionType;
|
|
|
|
|
1999-07-15 17:21:54 +02:00
|
|
|
|
1996-07-09 08:22:35 +02:00
|
|
|
/*
|
1999-02-14 00:22:53 +01:00
|
|
|
* prototypes for costsize.c
|
1996-07-09 08:22:35 +02:00
|
|
|
* routines to compute costs and sizes
|
|
|
|
*/
|
2000-01-23 00:50:30 +01:00
|
|
|
|
2019-01-29 21:48:51 +01:00
|
|
|
/* parameter variables and flags (see also optimizer.h) */
|
2018-02-09 21:54:45 +01:00
|
|
|
extern PGDLLIMPORT Cost disable_cost;
|
|
|
|
extern PGDLLIMPORT int max_parallel_workers_per_gather;
|
|
|
|
extern PGDLLIMPORT bool enable_seqscan;
|
|
|
|
extern PGDLLIMPORT bool enable_indexscan;
|
|
|
|
extern PGDLLIMPORT bool enable_indexonlyscan;
|
|
|
|
extern PGDLLIMPORT bool enable_bitmapscan;
|
|
|
|
extern PGDLLIMPORT bool enable_tidscan;
|
|
|
|
extern PGDLLIMPORT bool enable_sort;
|
2020-07-05 11:41:52 +02:00
|
|
|
extern PGDLLIMPORT bool enable_incremental_sort;
|
2018-02-09 21:54:45 +01:00
|
|
|
extern PGDLLIMPORT bool enable_hashagg;
|
|
|
|
extern PGDLLIMPORT bool enable_nestloop;
|
|
|
|
extern PGDLLIMPORT bool enable_material;
|
2021-07-14 02:43:58 +02:00
|
|
|
extern PGDLLIMPORT bool enable_memoize;
|
2018-02-09 21:54:45 +01:00
|
|
|
extern PGDLLIMPORT bool enable_mergejoin;
|
|
|
|
extern PGDLLIMPORT bool enable_hashjoin;
|
|
|
|
extern PGDLLIMPORT bool enable_gathermerge;
|
2018-02-16 16:33:59 +01:00
|
|
|
extern PGDLLIMPORT bool enable_partitionwise_join;
|
Implement partition-wise grouping/aggregation.
If the partition keys of input relation are part of the GROUP BY
clause, all the rows belonging to a given group come from a single
partition. This allows aggregation/grouping over a partitioned
relation to be broken down * into aggregation/grouping on each
partition. This should be no worse, and often better, than the normal
approach.
If the GROUP BY clause does not contain all the partition keys, we can
still perform partial aggregation for each partition and then finalize
aggregation after appending the partial results. This is less certain
to be a win, but it's still useful.
Jeevan Chalke, Ashutosh Bapat, Robert Haas. The larger patch series
of which this patch is a part was also reviewed and tested by Antonin
Houska, Rajkumar Raghuwanshi, David Rowley, Dilip Kumar, Konstantin
Knizhnik, Pascal Legrand, and Rafia Sabih.
Discussion: http://postgr.es/m/CAM2+6=V64_xhstVHie0Rz=KPEQnLJMZt_e314P0jaT_oJ9MR8A@mail.gmail.com
2018-03-22 17:49:48 +01:00
|
|
|
extern PGDLLIMPORT bool enable_partitionwise_aggregate;
|
2018-02-09 21:54:45 +01:00
|
|
|
extern PGDLLIMPORT bool enable_parallel_append;
|
|
|
|
extern PGDLLIMPORT bool enable_parallel_hash;
|
2018-04-23 22:57:43 +02:00
|
|
|
extern PGDLLIMPORT bool enable_partition_pruning;
|
Add support for asynchronous execution.
This implements asynchronous execution, which runs multiple parts of a
non-parallel-aware Append concurrently rather than serially to improve
performance when possible. Currently, the only node type that can be
run concurrently is a ForeignScan that is an immediate child of such an
Append. In the case where such ForeignScans access data on different
remote servers, this would run those ForeignScans concurrently, and
overlap the remote operations to be performed simultaneously, so it'll
improve the performance especially when the operations involve
time-consuming ones such as remote join and remote aggregation.
We may extend this to other node types such as joins or aggregates over
ForeignScans in the future.
This also adds the support for postgres_fdw, which is enabled by the
table-level/server-level option "async_capable". The default is false.
Robert Haas, Kyotaro Horiguchi, Thomas Munro, and myself. This commit
is mostly based on the patch proposed by Robert Haas, but also uses
stuff from the patch proposed by Kyotaro Horiguchi and from the patch
proposed by Thomas Munro. Reviewed by Kyotaro Horiguchi, Konstantin
Knizhnik, Andrey Lepikhov, Movead Li, Thomas Munro, Justin Pryzby, and
others.
Discussion: https://postgr.es/m/CA%2BTgmoaXQEt4tZ03FtQhnzeDEMzBck%2BLrni0UWHVVgOTnA6C1w%40mail.gmail.com
Discussion: https://postgr.es/m/CA%2BhUKGLBRyu0rHrDCMC4%3DRn3252gogyp1SjOgG8SEKKZv%3DFwfQ%40mail.gmail.com
Discussion: https://postgr.es/m/20200228.170650.667613673625155850.horikyota.ntt%40gmail.com
2021-03-31 11:45:00 +02:00
|
|
|
extern PGDLLIMPORT bool enable_async_append;
|
2018-02-09 21:54:45 +01:00
|
|
|
extern PGDLLIMPORT int constraint_exclusion;
|
1996-07-09 08:22:35 +02:00
|
|
|
|
2006-06-06 19:59:58 +02:00
|
|
|
extern double index_pages_fetched(double tuples_fetched, BlockNumber pages,
|
2006-09-20 00:49:53 +02:00
|
|
|
double index_pages, PlannerInfo *root);
|
Revise parameterized-path mechanism to fix assorted issues.
This patch adjusts the treatment of parameterized paths so that all paths
with the same parameterization (same set of required outer rels) for the
same relation will have the same rowcount estimate. We cache the rowcount
estimates to ensure that property, and hopefully save a few cycles too.
Doing this makes it practical for add_path_precheck to operate without
a rowcount estimate: it need only assume that paths with different
parameterizations never dominate each other, which is close enough to
true anyway for coarse filtering, because normally a more-parameterized
path should yield fewer rows thanks to having more join clauses to apply.
In add_path, we do the full nine yards of comparing rowcount estimates
along with everything else, so that we can discard parameterized paths that
don't actually have an advantage. This fixes some issues I'd found with
add_path rejecting parameterized paths on the grounds that they were more
expensive than not-parameterized ones, even though they yielded many fewer
rows and hence would be cheaper once subsequent joining was considered.
To make the same-rowcounts assumption valid, we have to require that any
parameterized path enforce *all* join clauses that could be obtained from
the particular set of outer rels, even if not all of them are useful for
indexing. This is required at both base scans and joins. It's a good
thing anyway since the net impact is that join quals are checked at the
lowest practical level in the join tree. Hence, discard the original
rather ad-hoc mechanism for choosing parameterization joinquals, and build
a better one that has a more principled rule for when clauses can be moved.
The original rule was actually buggy anyway for lack of knowledge about
which relations are part of an outer join's outer side; getting this right
requires adding an outer_relids field to RestrictInfo.
2012-04-19 21:52:46 +02:00
|
|
|
extern void cost_seqscan(Path *path, PlannerInfo *root, RelOptInfo *baserel,
|
2016-01-20 20:29:22 +01:00
|
|
|
ParamPathInfo *param_info);
|
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.
2015-07-25 20:39:00 +02:00
|
|
|
extern void cost_samplescan(Path *path, PlannerInfo *root, RelOptInfo *baserel,
|
|
|
|
ParamPathInfo *param_info);
|
2011-12-25 01:03:21 +01:00
|
|
|
extern void cost_index(IndexPath *path, PlannerInfo *root,
|
2017-02-15 19:53:24 +01:00
|
|
|
double loop_count, bool partial_path);
|
2005-06-06 00:32:58 +02:00
|
|
|
extern void cost_bitmap_heap_scan(Path *path, PlannerInfo *root, RelOptInfo *baserel,
|
Revise parameterized-path mechanism to fix assorted issues.
This patch adjusts the treatment of parameterized paths so that all paths
with the same parameterization (same set of required outer rels) for the
same relation will have the same rowcount estimate. We cache the rowcount
estimates to ensure that property, and hopefully save a few cycles too.
Doing this makes it practical for add_path_precheck to operate without
a rowcount estimate: it need only assume that paths with different
parameterizations never dominate each other, which is close enough to
true anyway for coarse filtering, because normally a more-parameterized
path should yield fewer rows thanks to having more join clauses to apply.
In add_path, we do the full nine yards of comparing rowcount estimates
along with everything else, so that we can discard parameterized paths that
don't actually have an advantage. This fixes some issues I'd found with
add_path rejecting parameterized paths on the grounds that they were more
expensive than not-parameterized ones, even though they yielded many fewer
rows and hence would be cheaper once subsequent joining was considered.
To make the same-rowcounts assumption valid, we have to require that any
parameterized path enforce *all* join clauses that could be obtained from
the particular set of outer rels, even if not all of them are useful for
indexing. This is required at both base scans and joins. It's a good
thing anyway since the net impact is that join quals are checked at the
lowest practical level in the join tree. Hence, discard the original
rather ad-hoc mechanism for choosing parameterization joinquals, and build
a better one that has a more principled rule for when clauses can be moved.
The original rule was actually buggy anyway for lack of knowledge about
which relations are part of an outer join's outer side; getting this right
requires adding an outer_relids field to RestrictInfo.
2012-04-19 21:52:46 +02:00
|
|
|
ParamPathInfo *param_info,
|
2012-01-28 01:26:38 +01:00
|
|
|
Path *bitmapqual, double loop_count);
|
2005-06-06 00:32:58 +02:00
|
|
|
extern void cost_bitmap_and_node(BitmapAndPath *path, PlannerInfo *root);
|
|
|
|
extern void cost_bitmap_or_node(BitmapOrPath *path, PlannerInfo *root);
|
2005-04-22 23:58:32 +02:00
|
|
|
extern void cost_bitmap_tree_node(Path *path, Cost *cost, Selectivity *selec);
|
2005-06-06 00:32:58 +02:00
|
|
|
extern void cost_tidscan(Path *path, PlannerInfo *root,
|
2012-08-27 04:48:55 +02:00
|
|
|
RelOptInfo *baserel, List *tidquals, ParamPathInfo *param_info);
|
2021-02-27 10:59:36 +01:00
|
|
|
extern void cost_tidrangescan(Path *path, PlannerInfo *root,
|
|
|
|
RelOptInfo *baserel, List *tidrangequals,
|
|
|
|
ParamPathInfo *param_info);
|
Make the upper part of the planner work by generating and comparing Paths.
I've been saying we needed to do this for more than five years, and here it
finally is. This patch removes the ever-growing tangle of spaghetti logic
that grouping_planner() used to use to try to identify the best plan for
post-scan/join query steps. Now, there is (nearly) independent
consideration of each execution step, and entirely separate construction of
Paths to represent each of the possible ways to do that step. We choose
the best Path or set of Paths using the same add_path() logic that's been
used inside query_planner() for years.
In addition, this patch removes the old restriction that subquery_planner()
could return only a single Plan. It now returns a RelOptInfo containing a
set of Paths, just as query_planner() does, and the parent query level can
use each of those Paths as the basis of a SubqueryScanPath at its level.
This allows finding some optimizations that we missed before, wherein a
subquery was capable of returning presorted data and thereby avoiding a
sort in the parent level, making the overall cost cheaper even though
delivering sorted output was not the cheapest plan for the subquery in
isolation. (A couple of regression test outputs change in consequence of
that. However, there is very little change in visible planner behavior
overall, because the point of this patch is not to get immediate planning
benefits but to create the infrastructure for future improvements.)
There is a great deal left to do here. This patch unblocks a lot of
planner work that was basically impractical in the old code structure,
such as allowing FDWs to implement remote aggregation, or rewriting
plan_set_operations() to allow consideration of multiple implementation
orders for set operations. (The latter will likely require a full
rewrite of plan_set_operations(); what I've done here is only to fix it
to return Paths not Plans.) I have also left unfinished some localized
refactoring in createplan.c and planner.c, because it was not necessary
to get this patch to a working state.
Thanks to Robert Haas, David Rowley, and Amit Kapila for review.
2016-03-07 21:58:22 +01:00
|
|
|
extern void cost_subqueryscan(SubqueryScanPath *path, PlannerInfo *root,
|
Revise parameterized-path mechanism to fix assorted issues.
This patch adjusts the treatment of parameterized paths so that all paths
with the same parameterization (same set of required outer rels) for the
same relation will have the same rowcount estimate. We cache the rowcount
estimates to ensure that property, and hopefully save a few cycles too.
Doing this makes it practical for add_path_precheck to operate without
a rowcount estimate: it need only assume that paths with different
parameterizations never dominate each other, which is close enough to
true anyway for coarse filtering, because normally a more-parameterized
path should yield fewer rows thanks to having more join clauses to apply.
In add_path, we do the full nine yards of comparing rowcount estimates
along with everything else, so that we can discard parameterized paths that
don't actually have an advantage. This fixes some issues I'd found with
add_path rejecting parameterized paths on the grounds that they were more
expensive than not-parameterized ones, even though they yielded many fewer
rows and hence would be cheaper once subsequent joining was considered.
To make the same-rowcounts assumption valid, we have to require that any
parameterized path enforce *all* join clauses that could be obtained from
the particular set of outer rels, even if not all of them are useful for
indexing. This is required at both base scans and joins. It's a good
thing anyway since the net impact is that join quals are checked at the
lowest practical level in the join tree. Hence, discard the original
rather ad-hoc mechanism for choosing parameterization joinquals, and build
a better one that has a more principled rule for when clauses can be moved.
The original rule was actually buggy anyway for lack of knowledge about
which relations are part of an outer join's outer side; getting this right
requires adding an outer_relids field to RestrictInfo.
2012-04-19 21:52:46 +02:00
|
|
|
RelOptInfo *baserel, ParamPathInfo *param_info);
|
2005-06-06 00:32:58 +02:00
|
|
|
extern void cost_functionscan(Path *path, PlannerInfo *root,
|
2012-08-08 01:02:54 +02:00
|
|
|
RelOptInfo *baserel, ParamPathInfo *param_info);
|
2006-08-02 03:59:48 +02:00
|
|
|
extern void cost_valuesscan(Path *path, PlannerInfo *root,
|
2012-08-12 22:01:26 +02:00
|
|
|
RelOptInfo *baserel, ParamPathInfo *param_info);
|
2017-03-08 16:39:37 +01:00
|
|
|
extern void cost_tablefuncscan(Path *path, PlannerInfo *root,
|
|
|
|
RelOptInfo *baserel, ParamPathInfo *param_info);
|
2012-08-27 04:48:55 +02:00
|
|
|
extern void cost_ctescan(Path *path, PlannerInfo *root,
|
2017-04-01 06:17:18 +02:00
|
|
|
RelOptInfo *baserel, ParamPathInfo *param_info);
|
|
|
|
extern void cost_namedtuplestorescan(Path *path, PlannerInfo *root,
|
|
|
|
RelOptInfo *baserel, ParamPathInfo *param_info);
|
In the planner, replace an empty FROM clause with a dummy RTE.
The fact that "SELECT expression" has no base relations has long been a
thorn in the side of the planner. It makes it hard to flatten a sub-query
that looks like that, or is a trivial VALUES() item, because the planner
generally uses relid sets to identify sub-relations, and such a sub-query
would have an empty relid set if we flattened it. prepjointree.c contains
some baroque logic that works around this in certain special cases --- but
there is a much better answer. We can replace an empty FROM clause with a
dummy RTE that acts like a table of one row and no columns, and then there
are no such corner cases to worry about. Instead we need some logic to
get rid of useless dummy RTEs, but that's simpler and covers more cases
than what was there before.
For really trivial cases, where the query is just "SELECT expression" and
nothing else, there's a hazard that adding the extra RTE makes for a
noticeable slowdown; even though it's not much processing, there's not
that much for the planner to do overall. However testing says that the
penalty is very small, close to the noise level. In more complex queries,
this is able to find optimizations that we could not find before.
The new RTE type is called RTE_RESULT, since the "scan" plan type it
gives rise to is a Result node (the same plan we produced for a "SELECT
expression" query before). To avoid confusion, rename the old ResultPath
path type to GroupResultPath, reflecting that it's only used in degenerate
grouping cases where we know the query produces just one grouped row.
(It wouldn't work to unify the two cases, because there are different
rules about where the associated quals live during query_planner.)
Note: although this touches readfuncs.c, I don't think a catversion
bump is required, because the added case can't occur in stored rules,
only plans.
Patch by me, reviewed by David Rowley and Mark Dilger
Discussion: https://postgr.es/m/15944.1521127664@sss.pgh.pa.us
2019-01-28 23:54:10 +01:00
|
|
|
extern void cost_resultscan(Path *path, PlannerInfo *root,
|
|
|
|
RelOptInfo *baserel, ParamPathInfo *param_info);
|
Make the upper part of the planner work by generating and comparing Paths.
I've been saying we needed to do this for more than five years, and here it
finally is. This patch removes the ever-growing tangle of spaghetti logic
that grouping_planner() used to use to try to identify the best plan for
post-scan/join query steps. Now, there is (nearly) independent
consideration of each execution step, and entirely separate construction of
Paths to represent each of the possible ways to do that step. We choose
the best Path or set of Paths using the same add_path() logic that's been
used inside query_planner() for years.
In addition, this patch removes the old restriction that subquery_planner()
could return only a single Plan. It now returns a RelOptInfo containing a
set of Paths, just as query_planner() does, and the parent query level can
use each of those Paths as the basis of a SubqueryScanPath at its level.
This allows finding some optimizations that we missed before, wherein a
subquery was capable of returning presorted data and thereby avoiding a
sort in the parent level, making the overall cost cheaper even though
delivering sorted output was not the cheapest plan for the subquery in
isolation. (A couple of regression test outputs change in consequence of
that. However, there is very little change in visible planner behavior
overall, because the point of this patch is not to get immediate planning
benefits but to create the infrastructure for future improvements.)
There is a great deal left to do here. This patch unblocks a lot of
planner work that was basically impractical in the old code structure,
such as allowing FDWs to implement remote aggregation, or rewriting
plan_set_operations() to allow consideration of multiple implementation
orders for set operations. (The latter will likely require a full
rewrite of plan_set_operations(); what I've done here is only to fix it
to return Paths not Plans.) I have also left unfinished some localized
refactoring in createplan.c and planner.c, because it was not necessary
to get this patch to a working state.
Thanks to Robert Haas, David Rowley, and Amit Kapila for review.
2016-03-07 21:58:22 +01:00
|
|
|
extern void cost_recursive_union(Path *runion, Path *nrterm, Path *rterm);
|
2005-06-06 00:32:58 +02:00
|
|
|
extern void cost_sort(Path *path, PlannerInfo *root,
|
2007-05-04 03:13:45 +02:00
|
|
|
List *pathkeys, Cost input_cost, double tuples, int width,
|
2010-10-08 02:00:28 +02:00
|
|
|
Cost comparison_cost, int sort_mem,
|
2007-05-04 03:13:45 +02:00
|
|
|
double limit_tuples);
|
Implement Incremental Sort
Incremental Sort is an optimized variant of multikey sort for cases when
the input is already sorted by a prefix of the requested sort keys. For
example when the relation is already sorted by (key1, key2) and we need
to sort it by (key1, key2, key3) we can simply split the input rows into
groups having equal values in (key1, key2), and only sort/compare the
remaining column key3.
This has a number of benefits:
- Reduced memory consumption, because only a single group (determined by
values in the sorted prefix) needs to be kept in memory. This may also
eliminate the need to spill to disk.
- Lower startup cost, because Incremental Sort produce results after each
prefix group, which is beneficial for plans where startup cost matters
(like for example queries with LIMIT clause).
We consider both Sort and Incremental Sort, and decide based on costing.
The implemented algorithm operates in two different modes:
- Fetching a minimum number of tuples without check of equality on the
prefix keys, and sorting on all columns when safe.
- Fetching all tuples for a single prefix group and then sorting by
comparing only the remaining (non-prefix) keys.
We always start in the first mode, and employ a heuristic to switch into
the second mode if we believe it's beneficial - the goal is to minimize
the number of unnecessary comparions while keeping memory consumption
below work_mem.
This is a very old patch series. The idea was originally proposed by
Alexander Korotkov back in 2013, and then revived in 2017. In 2018 the
patch was taken over by James Coleman, who wrote and rewrote most of the
current code.
There were many reviewers/contributors since 2013 - I've done my best to
pick the most active ones, and listed them in this commit message.
Author: James Coleman, Alexander Korotkov
Reviewed-by: Tomas Vondra, Andreas Karlsson, Marti Raudsepp, Peter Geoghegan, Robert Haas, Thomas Munro, Antonin Houska, Andres Freund, Alexander Kuzmenkov
Discussion: https://postgr.es/m/CAPpHfdscOX5an71nHd8WSUH6GNOCf=V7wgDaTXdDd9=goN-gfA@mail.gmail.com
Discussion: https://postgr.es/m/CAPpHfds1waRZ=NOmueYq0sx1ZSCnt+5QJvizT8ndT2=etZEeAQ@mail.gmail.com
2020-04-06 21:33:28 +02:00
|
|
|
extern void cost_incremental_sort(Path *path,
|
|
|
|
PlannerInfo *root, List *pathkeys, int presorted_keys,
|
|
|
|
Cost input_startup_cost, Cost input_total_cost,
|
|
|
|
double input_tuples, int width, Cost comparison_cost, int sort_mem,
|
|
|
|
double limit_tuples);
|
Revert "Optimize order of GROUP BY keys".
This reverts commit db0d67db2401eb6238ccc04c6407a4fd4f985832 and
several follow-on fixes. The idea of making a cost-based choice
of the order of the sorting columns is not fundamentally unsound,
but it requires cost information and data statistics that we don't
really have. For example, relying on procost to distinguish the
relative costs of different sort comparators is pretty pointless
so long as most such comparator functions are labeled with cost 1.0.
Moreover, estimating the number of comparisons done by Quicksort
requires more than just an estimate of the number of distinct values
in the input: you also need some idea of the sizes of the larger
groups, if you want an estimate that's good to better than a factor of
three or so. That's data that's often unknown or not very reliable.
Worse, to arrive at estimates of the number of calls made to the
lower-order-column comparison functions, the code needs to make
estimates of the numbers of distinct values of multiple columns,
which are necessarily even less trustworthy than per-column stats.
Even if all the inputs are perfectly reliable, the cost algorithm
as-implemented cannot offer useful information about how to order
sorting columns beyond the point at which the average group size
is estimated to drop to 1.
Close inspection of the code added by db0d67db2 shows that there
are also multiple small bugs. These could have been fixed, but
there's not much point if we don't trust the estimates to be
accurate in-principle.
Finally, the changes in cost_sort's behavior made for very large
changes (often a factor of 2 or so) in the cost estimates for all
sorting operations, not only those for multi-column GROUP BY.
That naturally changes plan choices in many situations, and there's
precious little evidence to show that the changes are for the better.
Given the above doubts about whether the new estimates are really
trustworthy, it's hard to summon much confidence that these changes
are better on the average.
Since we're hard up against the release deadline for v15, let's
revert these changes for now. We can always try again later.
Note: in v15, I left T_PathKeyInfo in place in nodes.h even though
it's unreferenced. Removing it would be an ABI break, and it seems
a bit late in the release cycle for that.
Discussion: https://postgr.es/m/TYAPR01MB586665EB5FB2C3807E893941F5579@TYAPR01MB5866.jpnprd01.prod.outlook.com
2022-10-03 16:56:16 +02:00
|
|
|
extern void cost_append(AppendPath *path);
|
2010-10-14 22:56:39 +02:00
|
|
|
extern void cost_merge_append(Path *path, PlannerInfo *root,
|
|
|
|
List *pathkeys, int n_streams,
|
|
|
|
Cost input_startup_cost, Cost input_total_cost,
|
|
|
|
double tuples);
|
2002-11-30 06:21:03 +01:00
|
|
|
extern void cost_material(Path *path,
|
2009-09-13 00:12:09 +02:00
|
|
|
Cost input_startup_cost, Cost input_total_cost,
|
|
|
|
double tuples, int width);
|
2005-06-06 00:32:58 +02:00
|
|
|
extern void cost_agg(Path *path, PlannerInfo *root,
|
2011-04-24 22:55:20 +02:00
|
|
|
AggStrategy aggstrategy, const AggClauseCosts *aggcosts,
|
2002-11-21 01:42:20 +01:00
|
|
|
int numGroupCols, double numGroups,
|
2017-11-02 16:24:12 +01:00
|
|
|
List *quals,
|
2002-11-21 01:42:20 +01:00
|
|
|
Cost input_startup_cost, Cost input_total_cost,
|
Disk-based Hash Aggregation.
While performing hash aggregation, track memory usage when adding new
groups to a hash table. If the memory usage exceeds work_mem, enter
"spill mode".
In spill mode, new groups are not created in the hash table(s), but
existing groups continue to be advanced if input tuples match. Tuples
that would cause a new group to be created are instead spilled to a
logical tape to be processed later.
The tuples are spilled in a partitioned fashion. When all tuples from
the outer plan are processed (either by advancing the group or
spilling the tuple), finalize and emit the groups from the hash
table. Then, create new batches of work from the spilled partitions,
and select one of the saved batches and process it (possibly spilling
recursively).
Author: Jeff Davis
Reviewed-by: Tomas Vondra, Adam Lee, Justin Pryzby, Taylor Vesely, Melanie Plageman
Discussion: https://postgr.es/m/507ac540ec7c20136364b5272acbcd4574aa76ef.camel@j-davis.com
2020-03-18 23:42:02 +01:00
|
|
|
double input_tuples, double input_width);
|
2008-12-28 19:54:01 +01:00
|
|
|
extern void cost_windowagg(Path *path, PlannerInfo *root,
|
2011-04-24 22:55:20 +02:00
|
|
|
List *windowFuncs, int numPartCols, int numOrderCols,
|
2008-12-28 19:54:01 +01:00
|
|
|
Cost input_startup_cost, Cost input_total_cost,
|
|
|
|
double input_tuples);
|
2005-06-06 00:32:58 +02:00
|
|
|
extern void cost_group(Path *path, PlannerInfo *root,
|
2002-11-21 01:42:20 +01:00
|
|
|
int numGroupCols, double numGroups,
|
2017-11-02 16:24:12 +01:00
|
|
|
List *quals,
|
2002-11-21 01:42:20 +01:00
|
|
|
Cost input_startup_cost, Cost input_total_cost,
|
|
|
|
double input_tuples);
|
2012-01-28 01:26:38 +01:00
|
|
|
extern void initial_cost_nestloop(PlannerInfo *root,
|
|
|
|
JoinCostWorkspace *workspace,
|
|
|
|
JoinType jointype,
|
|
|
|
Path *outer_path, Path *inner_path,
|
2017-04-08 04:20:03 +02:00
|
|
|
JoinPathExtraData *extra);
|
2012-01-28 01:26:38 +01:00
|
|
|
extern void final_cost_nestloop(PlannerInfo *root, NestPath *path,
|
|
|
|
JoinCostWorkspace *workspace,
|
2017-04-08 04:20:03 +02:00
|
|
|
JoinPathExtraData *extra);
|
2012-01-28 01:26:38 +01:00
|
|
|
extern void initial_cost_mergejoin(PlannerInfo *root,
|
|
|
|
JoinCostWorkspace *workspace,
|
|
|
|
JoinType jointype,
|
|
|
|
List *mergeclauses,
|
|
|
|
Path *outer_path, Path *inner_path,
|
|
|
|
List *outersortkeys, List *innersortkeys,
|
2017-04-08 04:20:03 +02:00
|
|
|
JoinPathExtraData *extra);
|
2012-01-28 01:26:38 +01:00
|
|
|
extern void final_cost_mergejoin(PlannerInfo *root, MergePath *path,
|
|
|
|
JoinCostWorkspace *workspace,
|
2017-04-08 04:20:03 +02:00
|
|
|
JoinPathExtraData *extra);
|
2012-01-28 01:26:38 +01:00
|
|
|
extern void initial_cost_hashjoin(PlannerInfo *root,
|
|
|
|
JoinCostWorkspace *workspace,
|
|
|
|
JoinType jointype,
|
|
|
|
List *hashclauses,
|
|
|
|
Path *outer_path, Path *inner_path,
|
Add parallel-aware hash joins.
Introduce parallel-aware hash joins that appear in EXPLAIN plans as Parallel
Hash Join with Parallel Hash. While hash joins could already appear in
parallel queries, they were previously always parallel-oblivious and had a
partial subplan only on the outer side, meaning that the work of the inner
subplan was duplicated in every worker.
After this commit, the planner will consider using a partial subplan on the
inner side too, using the Parallel Hash node to divide the work over the
available CPU cores and combine its results in shared memory. If the join
needs to be split into multiple batches in order to respect work_mem, then
workers process different batches as much as possible and then work together
on the remaining batches.
The advantages of a parallel-aware hash join over a parallel-oblivious hash
join used in a parallel query are that it:
* avoids wasting memory on duplicated hash tables
* avoids wasting disk space on duplicated batch files
* divides the work of building the hash table over the CPUs
One disadvantage is that there is some communication between the participating
CPUs which might outweigh the benefits of parallelism in the case of small
hash tables. This is avoided by the planner's existing reluctance to supply
partial plans for small scans, but it may be necessary to estimate
synchronization costs in future if that situation changes. Another is that
outer batch 0 must be written to disk if multiple batches are required.
A potential future advantage of parallel-aware hash joins is that right and
full outer joins could be supported, since there is a single set of matched
bits for each hashtable, but that is not yet implemented.
A new GUC enable_parallel_hash is defined to control the feature, defaulting
to on.
Author: Thomas Munro
Reviewed-By: Andres Freund, Robert Haas
Tested-By: Rafia Sabih, Prabhat Sahu
Discussion:
https://postgr.es/m/CAEepm=2W=cOkiZxcg6qiFQP-dHUe09aqTrEMM7yJDrHMhDv_RA@mail.gmail.com
https://postgr.es/m/CAEepm=37HKyJ4U6XOLi=JgfSHM3o6B-GaeO-6hkOmneTDkH+Uw@mail.gmail.com
2017-12-21 08:39:21 +01:00
|
|
|
JoinPathExtraData *extra,
|
|
|
|
bool parallel_hash);
|
2012-01-28 01:26:38 +01:00
|
|
|
extern void final_cost_hashjoin(PlannerInfo *root, HashPath *path,
|
|
|
|
JoinCostWorkspace *workspace,
|
2017-04-08 04:20:03 +02:00
|
|
|
JoinPathExtraData *extra);
|
Add a Gather executor node.
A Gather executor node runs any number of copies of a plan in an equal
number of workers and merges all of the results into a single tuple
stream. It can also run the plan itself, if the workers are
unavailable or haven't started up yet. It is intended to work with
the Partial Seq Scan node which will be added in future commits.
It could also be used to implement parallel query of a different sort
by itself, without help from Partial Seq Scan, if the single_copy mode
is used. In that mode, a worker executes the plan, and the parallel
leader does not, merely collecting the worker's results. So, a Gather
node could be inserted into a plan to split the execution of that plan
across two processes. Nested Gather nodes aren't currently supported,
but we might want to add support for that in the future.
There's nothing in the planner to actually generate Gather nodes yet,
so it's not quite time to break out the champagne. But we're getting
close.
Amit Kapila. Some designs suggestions were provided by me, and I also
reviewed the patch. Single-copy mode, documentation, and other minor
changes also by me.
2015-10-01 01:23:36 +02:00
|
|
|
extern void cost_gather(GatherPath *path, PlannerInfo *root,
|
2016-03-21 14:20:53 +01:00
|
|
|
RelOptInfo *baserel, ParamPathInfo *param_info, double *rows);
|
2019-01-29 21:48:51 +01:00
|
|
|
extern void cost_gather_merge(GatherMergePath *path, PlannerInfo *root,
|
|
|
|
RelOptInfo *rel, ParamPathInfo *param_info,
|
|
|
|
Cost input_startup_cost, Cost input_total_cost,
|
|
|
|
double *rows);
|
2008-08-22 02:16:04 +02:00
|
|
|
extern void cost_subplan(PlannerInfo *root, SubPlan *subplan, Plan *plan);
|
2007-02-22 23:00:26 +01:00
|
|
|
extern void cost_qual_eval(QualCost *cost, List *quals, PlannerInfo *root);
|
|
|
|
extern void cost_qual_eval_node(QualCost *cost, Node *qual, PlannerInfo *root);
|
2012-01-28 01:26:38 +01:00
|
|
|
extern void compute_semi_anti_join_factors(PlannerInfo *root,
|
2018-04-20 22:00:47 +02:00
|
|
|
RelOptInfo *joinrel,
|
2012-01-28 01:26:38 +01:00
|
|
|
RelOptInfo *outerrel,
|
|
|
|
RelOptInfo *innerrel,
|
|
|
|
JoinType jointype,
|
|
|
|
SpecialJoinInfo *sjinfo,
|
|
|
|
List *restrictlist,
|
|
|
|
SemiAntiJoinFactors *semifactors);
|
2005-06-06 00:32:58 +02:00
|
|
|
extern void set_baserel_size_estimates(PlannerInfo *root, RelOptInfo *rel);
|
Revise parameterized-path mechanism to fix assorted issues.
This patch adjusts the treatment of parameterized paths so that all paths
with the same parameterization (same set of required outer rels) for the
same relation will have the same rowcount estimate. We cache the rowcount
estimates to ensure that property, and hopefully save a few cycles too.
Doing this makes it practical for add_path_precheck to operate without
a rowcount estimate: it need only assume that paths with different
parameterizations never dominate each other, which is close enough to
true anyway for coarse filtering, because normally a more-parameterized
path should yield fewer rows thanks to having more join clauses to apply.
In add_path, we do the full nine yards of comparing rowcount estimates
along with everything else, so that we can discard parameterized paths that
don't actually have an advantage. This fixes some issues I'd found with
add_path rejecting parameterized paths on the grounds that they were more
expensive than not-parameterized ones, even though they yielded many fewer
rows and hence would be cheaper once subsequent joining was considered.
To make the same-rowcounts assumption valid, we have to require that any
parameterized path enforce *all* join clauses that could be obtained from
the particular set of outer rels, even if not all of them are useful for
indexing. This is required at both base scans and joins. It's a good
thing anyway since the net impact is that join quals are checked at the
lowest practical level in the join tree. Hence, discard the original
rather ad-hoc mechanism for choosing parameterization joinquals, and build
a better one that has a more principled rule for when clauses can be moved.
The original rule was actually buggy anyway for lack of knowledge about
which relations are part of an outer join's outer side; getting this right
requires adding an outer_relids field to RestrictInfo.
2012-04-19 21:52:46 +02:00
|
|
|
extern double get_parameterized_baserel_size(PlannerInfo *root,
|
|
|
|
RelOptInfo *rel,
|
|
|
|
List *param_clauses);
|
|
|
|
extern double get_parameterized_joinrel_size(PlannerInfo *root,
|
|
|
|
RelOptInfo *rel,
|
2016-06-18 21:22:34 +02:00
|
|
|
Path *outer_path,
|
|
|
|
Path *inner_path,
|
Revise parameterized-path mechanism to fix assorted issues.
This patch adjusts the treatment of parameterized paths so that all paths
with the same parameterization (same set of required outer rels) for the
same relation will have the same rowcount estimate. We cache the rowcount
estimates to ensure that property, and hopefully save a few cycles too.
Doing this makes it practical for add_path_precheck to operate without
a rowcount estimate: it need only assume that paths with different
parameterizations never dominate each other, which is close enough to
true anyway for coarse filtering, because normally a more-parameterized
path should yield fewer rows thanks to having more join clauses to apply.
In add_path, we do the full nine yards of comparing rowcount estimates
along with everything else, so that we can discard parameterized paths that
don't actually have an advantage. This fixes some issues I'd found with
add_path rejecting parameterized paths on the grounds that they were more
expensive than not-parameterized ones, even though they yielded many fewer
rows and hence would be cheaper once subsequent joining was considered.
To make the same-rowcounts assumption valid, we have to require that any
parameterized path enforce *all* join clauses that could be obtained from
the particular set of outer rels, even if not all of them are useful for
indexing. This is required at both base scans and joins. It's a good
thing anyway since the net impact is that join quals are checked at the
lowest practical level in the join tree. Hence, discard the original
rather ad-hoc mechanism for choosing parameterization joinquals, and build
a better one that has a more principled rule for when clauses can be moved.
The original rule was actually buggy anyway for lack of knowledge about
which relations are part of an outer join's outer side; getting this right
requires adding an outer_relids field to RestrictInfo.
2012-04-19 21:52:46 +02:00
|
|
|
SpecialJoinInfo *sjinfo,
|
|
|
|
List *restrict_clauses);
|
2005-06-06 00:32:58 +02:00
|
|
|
extern void set_joinrel_size_estimates(PlannerInfo *root, RelOptInfo *rel,
|
2000-02-07 05:41:04 +01:00
|
|
|
RelOptInfo *outer_rel,
|
|
|
|
RelOptInfo *inner_rel,
|
2008-08-14 20:48:00 +02:00
|
|
|
SpecialJoinInfo *sjinfo,
|
2000-02-07 05:41:04 +01:00
|
|
|
List *restrictlist);
|
2011-09-03 21:35:12 +02:00
|
|
|
extern void set_subquery_size_estimates(PlannerInfo *root, RelOptInfo *rel);
|
2005-06-06 00:32:58 +02:00
|
|
|
extern void set_function_size_estimates(PlannerInfo *root, RelOptInfo *rel);
|
2006-08-02 03:59:48 +02:00
|
|
|
extern void set_values_size_estimates(PlannerInfo *root, RelOptInfo *rel);
|
2008-10-04 23:56:55 +02:00
|
|
|
extern void set_cte_size_estimates(PlannerInfo *root, RelOptInfo *rel,
|
Make the upper part of the planner work by generating and comparing Paths.
I've been saying we needed to do this for more than five years, and here it
finally is. This patch removes the ever-growing tangle of spaghetti logic
that grouping_planner() used to use to try to identify the best plan for
post-scan/join query steps. Now, there is (nearly) independent
consideration of each execution step, and entirely separate construction of
Paths to represent each of the possible ways to do that step. We choose
the best Path or set of Paths using the same add_path() logic that's been
used inside query_planner() for years.
In addition, this patch removes the old restriction that subquery_planner()
could return only a single Plan. It now returns a RelOptInfo containing a
set of Paths, just as query_planner() does, and the parent query level can
use each of those Paths as the basis of a SubqueryScanPath at its level.
This allows finding some optimizations that we missed before, wherein a
subquery was capable of returning presorted data and thereby avoiding a
sort in the parent level, making the overall cost cheaper even though
delivering sorted output was not the cheapest plan for the subquery in
isolation. (A couple of regression test outputs change in consequence of
that. However, there is very little change in visible planner behavior
overall, because the point of this patch is not to get immediate planning
benefits but to create the infrastructure for future improvements.)
There is a great deal left to do here. This patch unblocks a lot of
planner work that was basically impractical in the old code structure,
such as allowing FDWs to implement remote aggregation, or rewriting
plan_set_operations() to allow consideration of multiple implementation
orders for set operations. (The latter will likely require a full
rewrite of plan_set_operations(); what I've done here is only to fix it
to return Paths not Plans.) I have also left unfinished some localized
refactoring in createplan.c and planner.c, because it was not necessary
to get this patch to a working state.
Thanks to Robert Haas, David Rowley, and Amit Kapila for review.
2016-03-07 21:58:22 +01:00
|
|
|
double cte_rows);
|
2017-03-08 16:39:37 +01:00
|
|
|
extern void set_tablefunc_size_estimates(PlannerInfo *root, RelOptInfo *rel);
|
2017-04-01 06:17:18 +02:00
|
|
|
extern void set_namedtuplestore_size_estimates(PlannerInfo *root, RelOptInfo *rel);
|
In the planner, replace an empty FROM clause with a dummy RTE.
The fact that "SELECT expression" has no base relations has long been a
thorn in the side of the planner. It makes it hard to flatten a sub-query
that looks like that, or is a trivial VALUES() item, because the planner
generally uses relid sets to identify sub-relations, and such a sub-query
would have an empty relid set if we flattened it. prepjointree.c contains
some baroque logic that works around this in certain special cases --- but
there is a much better answer. We can replace an empty FROM clause with a
dummy RTE that acts like a table of one row and no columns, and then there
are no such corner cases to worry about. Instead we need some logic to
get rid of useless dummy RTEs, but that's simpler and covers more cases
than what was there before.
For really trivial cases, where the query is just "SELECT expression" and
nothing else, there's a hazard that adding the extra RTE makes for a
noticeable slowdown; even though it's not much processing, there's not
that much for the planner to do overall. However testing says that the
penalty is very small, close to the noise level. In more complex queries,
this is able to find optimizations that we could not find before.
The new RTE type is called RTE_RESULT, since the "scan" plan type it
gives rise to is a Result node (the same plan we produced for a "SELECT
expression" query before). To avoid confusion, rename the old ResultPath
path type to GroupResultPath, reflecting that it's only used in degenerate
grouping cases where we know the query produces just one grouped row.
(It wouldn't work to unify the two cases, because there are different
rules about where the associated quals live during query_planner.)
Note: although this touches readfuncs.c, I don't think a catversion
bump is required, because the added case can't occur in stored rules,
only plans.
Patch by me, reviewed by David Rowley and Mark Dilger
Discussion: https://postgr.es/m/15944.1521127664@sss.pgh.pa.us
2019-01-28 23:54:10 +01:00
|
|
|
extern void set_result_size_estimates(PlannerInfo *root, RelOptInfo *rel);
|
2011-02-20 06:17:18 +01:00
|
|
|
extern void set_foreign_size_estimates(PlannerInfo *root, RelOptInfo *rel);
|
Make the upper part of the planner work by generating and comparing Paths.
I've been saying we needed to do this for more than five years, and here it
finally is. This patch removes the ever-growing tangle of spaghetti logic
that grouping_planner() used to use to try to identify the best plan for
post-scan/join query steps. Now, there is (nearly) independent
consideration of each execution step, and entirely separate construction of
Paths to represent each of the possible ways to do that step. We choose
the best Path or set of Paths using the same add_path() logic that's been
used inside query_planner() for years.
In addition, this patch removes the old restriction that subquery_planner()
could return only a single Plan. It now returns a RelOptInfo containing a
set of Paths, just as query_planner() does, and the parent query level can
use each of those Paths as the basis of a SubqueryScanPath at its level.
This allows finding some optimizations that we missed before, wherein a
subquery was capable of returning presorted data and thereby avoiding a
sort in the parent level, making the overall cost cheaper even though
delivering sorted output was not the cheapest plan for the subquery in
isolation. (A couple of regression test outputs change in consequence of
that. However, there is very little change in visible planner behavior
overall, because the point of this patch is not to get immediate planning
benefits but to create the infrastructure for future improvements.)
There is a great deal left to do here. This patch unblocks a lot of
planner work that was basically impractical in the old code structure,
such as allowing FDWs to implement remote aggregation, or rewriting
plan_set_operations() to allow consideration of multiple implementation
orders for set operations. (The latter will likely require a full
rewrite of plan_set_operations(); what I've done here is only to fix it
to return Paths not Plans.) I have also left unfinished some localized
refactoring in createplan.c and planner.c, because it was not necessary
to get this patch to a working state.
Thanks to Robert Haas, David Rowley, and Amit Kapila for review.
2016-03-07 21:58:22 +01:00
|
|
|
extern PathTarget *set_pathtarget_cost_width(PlannerInfo *root, PathTarget *target);
|
2017-01-27 22:22:11 +01:00
|
|
|
extern double compute_bitmap_pages(PlannerInfo *root, RelOptInfo *baserel,
|
|
|
|
Path *bitmapqual, int loop_count, Cost *cost, double *tuple);
|
1996-07-09 08:22:35 +02:00
|
|
|
|
|
|
|
#endif /* COST_H */
|