Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
280de290
Commit
280de290
authored
Apr 04, 2005
by
Tom Lane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
In cost_mergejoin, the early-exit effect should not apply to the
outer side of an outer join. Per andrew@supernews.
parent
503edbdb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
7 deletions
+12
-7
src/backend/optimizer/path/costsize.c
src/backend/optimizer/path/costsize.c
+12
-7
No files found.
src/backend/optimizer/path/costsize.c
View file @
280de290
...
...
@@ -49,7 +49,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/optimizer/path/costsize.c,v 1.14
0 2005/03/27 23:53:0
2 tgl Exp $
* $PostgreSQL: pgsql/src/backend/optimizer/path/costsize.c,v 1.14
1 2005/04/04 01:43:1
2 tgl Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -917,16 +917,17 @@ cost_mergejoin(MergePath *path, Query *root)
rescanratio
=
1
.
0
+
(
rescannedtuples
/
inner_path_rows
);
/*
* A merge join will stop as soon as it exhausts either input stream.
* Estimate fraction of the left and right inputs that will actually
* need to be scanned. We use only the first (most significant) merge
* clause for this purpose.
* A merge join will stop as soon as it exhausts either input stream
* (unless it's an outer join, in which case the outer side has to be
* scanned all the way anyway). Estimate fraction of the left and right
* inputs that will actually need to be scanned. We use only the first
* (most significant) merge clause for this purpose.
*
* Since this calculation is somewhat expensive, and will be the same for
* all mergejoin paths associated with the merge clause, we cache the
* results in the RestrictInfo node.
*/
if
(
mergeclauses
)
if
(
mergeclauses
&&
path
->
jpath
.
jointype
!=
JOIN_FULL
)
{
firstclause
=
(
RestrictInfo
*
)
linitial
(
mergeclauses
);
if
(
firstclause
->
left_mergescansel
<
0
)
/* not computed yet? */
...
...
@@ -946,10 +947,14 @@ cost_mergejoin(MergePath *path, Query *root)
outerscansel
=
firstclause
->
right_mergescansel
;
innerscansel
=
firstclause
->
left_mergescansel
;
}
if
(
path
->
jpath
.
jointype
==
JOIN_LEFT
)
outerscansel
=
1
.
0
;
else
if
(
path
->
jpath
.
jointype
==
JOIN_RIGHT
)
innerscansel
=
1
.
0
;
}
else
{
/* cope with clauseless mergejoin */
/* cope with clauseless
or full
mergejoin */
outerscansel
=
innerscansel
=
1
.
0
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment