Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
postgres-lambda-diff
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jakob Huber
postgres-lambda-diff
Commits
48239e15
Commit
48239e15
authored
18 years ago
by
Tom Lane
Browse files
Options
Downloads
Patches
Plain Diff
Avoid useless work during set_plain_rel_pathlist() when the relation
will be excluded by constraint exclusion anyway. Greg Stark
parent
925ca9d7
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/backend/optimizer/path/allpaths.c
+19
-17
19 additions, 17 deletions
src/backend/optimizer/path/allpaths.c
with
19 additions
and
17 deletions
src/backend/optimizer/path/allpaths.c
+
19
−
17
View file @
48239e15
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/optimizer/path/allpaths.c,v 1.16
1
2007/0
2
/2
2 22:00:23
tgl Exp $
* $PostgreSQL: pgsql/src/backend/optimizer/path/allpaths.c,v 1.16
2
2007/0
4
/2
1 06:18:52
tgl Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -196,20 +196,6 @@ set_rel_pathlist(PlannerInfo *root, RelOptInfo *rel, Index rti)
...
@@ -196,20 +196,6 @@ set_rel_pathlist(PlannerInfo *root, RelOptInfo *rel, Index rti)
static
void
static
void
set_plain_rel_pathlist
(
PlannerInfo
*
root
,
RelOptInfo
*
rel
,
RangeTblEntry
*
rte
)
set_plain_rel_pathlist
(
PlannerInfo
*
root
,
RelOptInfo
*
rel
,
RangeTblEntry
*
rte
)
{
{
/* Mark rel with estimated output rows, width, etc */
set_baserel_size_estimates
(
root
,
rel
);
/* Test any partial indexes of rel for applicability */
check_partial_indexes
(
root
,
rel
);
/*
* Check to see if we can extract any restriction conditions from join
* quals that are OR-of-AND structures. If so, add them to the rel's
* restriction list, and recompute the size estimates.
*/
if
(
create_or_index_quals
(
root
,
rel
))
set_baserel_size_estimates
(
root
,
rel
);
/*
/*
* If we can prove we don't need to scan the rel via constraint exclusion,
* If we can prove we don't need to scan the rel via constraint exclusion,
* set up a single dummy path for it. (Rather than inventing a special
* set up a single dummy path for it. (Rather than inventing a special
...
@@ -217,8 +203,9 @@ set_plain_rel_pathlist(PlannerInfo *root, RelOptInfo *rel, RangeTblEntry *rte)
...
@@ -217,8 +203,9 @@ set_plain_rel_pathlist(PlannerInfo *root, RelOptInfo *rel, RangeTblEntry *rte)
*/
*/
if
(
relation_excluded_by_constraints
(
rel
,
rte
))
if
(
relation_excluded_by_constraints
(
rel
,
rte
))
{
{
/*
Reset output-rows estimate to 0
*/
/*
Set dummy size estimates --- we leave attr_widths[] as zeroes
*/
rel
->
rows
=
0
;
rel
->
rows
=
0
;
rel
->
width
=
0
;
add_path
(
rel
,
(
Path
*
)
create_append_path
(
rel
,
NIL
));
add_path
(
rel
,
(
Path
*
)
create_append_path
(
rel
,
NIL
));
...
@@ -228,6 +215,20 @@ set_plain_rel_pathlist(PlannerInfo *root, RelOptInfo *rel, RangeTblEntry *rte)
...
@@ -228,6 +215,20 @@ set_plain_rel_pathlist(PlannerInfo *root, RelOptInfo *rel, RangeTblEntry *rte)
return
;
return
;
}
}
/* Mark rel with estimated output rows, width, etc */
set_baserel_size_estimates
(
root
,
rel
);
/* Test any partial indexes of rel for applicability */
check_partial_indexes
(
root
,
rel
);
/*
* Check to see if we can extract any restriction conditions from join
* quals that are OR-of-AND structures. If so, add them to the rel's
* restriction list, and recompute the size estimates.
*/
if
(
create_or_index_quals
(
root
,
rel
))
set_baserel_size_estimates
(
root
,
rel
);
/*
/*
* Generate paths and add them to the rel's pathlist.
* Generate paths and add them to the rel's pathlist.
*
*
...
@@ -369,7 +370,8 @@ set_append_rel_pathlist(PlannerInfo *root, RelOptInfo *rel,
...
@@ -369,7 +370,8 @@ set_append_rel_pathlist(PlannerInfo *root, RelOptInfo *rel,
/*
/*
* Propagate size information from the child back to the parent. For
* Propagate size information from the child back to the parent. For
* simplicity, we use the largest widths from any child as the parent
* simplicity, we use the largest widths from any child as the parent
* estimates.
* estimates. (If you want to change this, beware of child
* attr_widths[] entries that haven't been set and are still 0.)
*/
*/
rel
->
rows
+=
childrel
->
rows
;
rel
->
rows
+=
childrel
->
rows
;
if
(
childrel
->
width
>
rel
->
width
)
if
(
childrel
->
width
>
rel
->
width
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment