aboutsummaryrefslogtreecommitdiff
path: root/src/backend/optimizer/util/pathnode.c
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>1999-02-12 02:37:52 +0000
committerBruce Momjian <bruce@momjian.us>1999-02-12 02:37:52 +0000
commit55d0465009b99d340c643dafae8a6a0846e45de1 (patch)
treec38706161a4ef2cb23b7a4f78b553b06b59662c1 /src/backend/optimizer/util/pathnode.c
parent847da1a1ee4b066800effea20369318bb7e3c9d3 (diff)
downloadpostgresql-55d0465009b99d340c643dafae8a6a0846e45de1.tar.gz
postgresql-55d0465009b99d340c643dafae8a6a0846e45de1.zip
optimizer update
Diffstat (limited to 'src/backend/optimizer/util/pathnode.c')
-rw-r--r--src/backend/optimizer/util/pathnode.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/backend/optimizer/util/pathnode.c b/src/backend/optimizer/util/pathnode.c
index 23e3e8ee0c2..43db1bd267f 100644
--- a/src/backend/optimizer/util/pathnode.c
+++ b/src/backend/optimizer/util/pathnode.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/optimizer/util/pathnode.c,v 1.31 1999/02/11 21:05:28 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/optimizer/util/pathnode.c,v 1.32 1999/02/12 02:37:52 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -211,19 +211,25 @@ better_path(Path *new_path, List *unique_paths, bool *is_new)
new_path->path_cost <= path->path_cost))
{
*is_new = false;
- return new_path;
+ return path;
}
/* same keys, new is more expensive, stop */
- else if
- ((better_key == 0 && better_sort == 0 &&
- new_path->path_cost >= path->path_cost) ||
+ if ((better_key == 0 && better_sort == 0 &&
+ new_path->path_cost >= path->path_cost) ||
/* old is better, and less expensive, stop */
(((better_key == 2 && better_sort != 1) ||
(better_key != 1 && better_sort == 2)) &&
new_path->path_cost >= path->path_cost))
{
+#ifdef OPTDB_DEBUG
+ printf("better key %d better sort %d\n", better_key, better_sort);
+ printf("new\n");
+ pprint(new_path);
+ printf("old\n");
+ pprint(path);
+#endif
*is_new = false;
return NULL;
}