Skip to content

Commit 4ec8a14

Browse files
committed
Add innercost to result in cost_hashjoin.
1 parent 72b523d commit 4ec8a14

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

src/backend/optimizer/path/costsize.c

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/costsize.c,v 1.14 1997/04/09 02:13:41 vadim Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/costsize.c,v 1.15 1997/04/24 15:49:30 vadim Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -321,15 +321,19 @@ cost_hashjoin(Cost outercost,
321321
return _disable_cost_;
322322
if ( !_enable_hashjoin_ )
323323
temp += _disable_cost_;
324-
/* temp += outercost + (nrun + 1) * innercost; */
325-
/*
326-
the innercost shouldn't be used it. Instead the
327-
cost of hashing the innerpath should be used
328-
329-
ASSUME innercost is 1 for now -- a horrible hack
330-
- jolly
331-
*/
324+
/*
325+
temp += outercost + (nrun + 1) * innercost;
326+
*
327+
* the innercost shouldn't be used it. Instead the
328+
* cost of hashing the innerpath should be used
329+
*
330+
* ASSUME innercost is 1 for now -- a horrible hack
331+
* - jolly
332332
temp += outercost + (nrun + 1);
333+
*
334+
* But we must add innercost to result. - vadim 04/24/97
335+
*/
336+
temp += outercost + innercost + (nrun + 1);
333337

334338
temp += _cpu_page_wight_ * (outersize + nrun * innersize);
335339
Assert(temp >= 0);

0 commit comments

Comments
 (0)