Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit70fba70

Browse files
committed
Upgrade cost estimation for joins, per discussion with Bradley Baetz.
Try to model the effect of rescanning input tuples in mergejoins;account for JOIN_IN short-circuiting where appropriate. Also, recognizethat mergejoin and hashjoin clauses may now be more than single operatorcalls, so we have to charge appropriate execution costs.
1 parentb2773d4 commit70fba70

File tree

10 files changed

+358
-187
lines changed

10 files changed

+358
-187
lines changed

‎src/backend/executor/nodeHashjoin.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/executor/nodeHashjoin.c,v 1.47 2003/01/20 18:54:45 tgl Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/executor/nodeHashjoin.c,v 1.48 2003/01/27 20:51:48 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -253,6 +253,13 @@ ExecHashJoin(HashJoinState *node)
253253
returnresult;
254254
}
255255
}
256+
257+
/* If we didn't return a tuple, may need to set NeedNewOuter */
258+
if (node->js.jointype==JOIN_IN)
259+
{
260+
node->hj_NeedNewOuter= true;
261+
break;/* out of loop over hash bucket */
262+
}
256263
}
257264
}
258265

‎src/backend/executor/nodeNestloop.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/executor/nodeNestloop.c,v 1.30 2003/01/20 18:54:46 tgl Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/executor/nodeNestloop.c,v 1.31 2003/01/27 20:51:48 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -254,6 +254,10 @@ ExecNestLoop(NestLoopState *node)
254254
returnresult;
255255
}
256256
}
257+
258+
/* If we didn't return a tuple, may need to set NeedNewOuter */
259+
if (node->js.jointype==JOIN_IN)
260+
node->nl_NeedNewOuter= true;
257261
}
258262

259263
/*

‎src/backend/nodes/list.c

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/nodes/list.c,v 1.45 2003/01/24 03:58:34 tgl Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/nodes/list.c,v 1.46 2003/01/27 20:51:49 tgl Exp $
1212
*
1313
* NOTES
1414
* XXX a few of the following functions are duplicated to handle
@@ -639,6 +639,28 @@ set_differencei(List *l1, List *l2)
639639
returnresult;
640640
}
641641

642+
/*
643+
*set_ptrDifference
644+
*
645+
*Same as set_difference, when pointer-equality comparison is sufficient
646+
*/
647+
List*
648+
set_ptrDifference(List*l1,List*l2)
649+
{
650+
List*result=NIL;
651+
List*i;
652+
653+
if (l2==NIL)
654+
returnlistCopy(l1);/* slightly faster path for empty l2 */
655+
656+
foreach(i,l1)
657+
{
658+
if (!ptrMember(lfirst(i),l2))
659+
result=lappend(result,lfirst(i));
660+
}
661+
returnresult;
662+
}
663+
642664
/*
643665
* Reverse a list, non-destructively
644666
*/

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp