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

Commit129543e

Browse files
committed
optimizer cleanup
1 parentdbd80c9 commit129543e

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

‎src/backend/optimizer/path/joinutils.c

Lines changed: 2 additions & 3 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/Attic/joinutils.c,v 1.16 1999/02/10 21:02:39 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/joinutils.c,v 1.17 1999/02/11 05:29:07 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -373,8 +373,7 @@ new_join_pathkey(List *subkeys,
373373
if (tlist_key)
374374
{
375375
if (!member(tlist_key,matched_subkeys))
376-
newly_considered_subkeys=lcons(tlist_key,
377-
matched_subkeys);
376+
newly_considered_subkeys=lcons(tlist_key,matched_subkeys);
378377
}
379378
else
380379
newly_considered_subkeys=matched_subkeys;

‎src/backend/optimizer/util/pathnode.c

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/pathnode.c,v 1.24 1999/02/1104:08:43 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/pathnode.c,v 1.25 1999/02/1105:29:08 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -195,14 +195,19 @@ better_path(Path *new_path, List *unique_paths, bool *is_new)
195195
* more expensive and replace unordered path with ordered
196196
* path if it is not more expensive.
197197
*/
198+
199+
/* same keys, and new is cheaper, use it */
198200
if ((longer_key==0&&new_path->path_cost<path->path_cost)||
199-
(longer_key==1&&new_path->path_cost <=path->path_cost)||
200-
(longer_key==2&&new_path->path_cost>=path->path_cost))
201+
/* new is longer, and cheaper, use it */
202+
(longer_key==1&&new_path->path_cost<=path->path_cost))
201203
{
202204
*is_new= false;
203205
returnnew_path;
204206
}
205-
else
207+
/* same keys, new is more expensive, stop */
208+
elseif ((longer_key==0&&new_path->path_cost >=path->path_cost)||
209+
/* old is longer, and less expensive, stop */
210+
(longer_key==2&&new_path->path_cost >=path->path_cost))
206211
{
207212
*is_new= false;
208213
returnNULL;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp