aboutsummaryrefslogtreecommitdiff
path: root/src/backend/optimizer/util
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/optimizer/util')
-rw-r--r--src/backend/optimizer/util/indexnode.c3
-rw-r--r--src/backend/optimizer/util/pathnode.c36
-rw-r--r--src/backend/optimizer/util/relnode.c3
3 files changed, 31 insertions, 11 deletions
diff --git a/src/backend/optimizer/util/indexnode.c b/src/backend/optimizer/util/indexnode.c
index e1aab56d3a8..dafeb8ddee3 100644
--- a/src/backend/optimizer/util/indexnode.c
+++ b/src/backend/optimizer/util/indexnode.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/optimizer/util/Attic/indexnode.c,v 1.12 1999/02/10 21:02:40 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/optimizer/util/Attic/indexnode.c,v 1.13 1999/02/12 05:56:55 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -78,7 +78,6 @@ find_secondary_index(Query *root, Oid relid)
indexnode->width = 0;
indexnode->targetlist = NIL;
indexnode->pathlist = NIL;
- indexnode->unorderedpath = NULL;
indexnode->cheapestpath = NULL;
indexnode->pruneable = true;
indexnode->restrictinfo = NIL;
diff --git a/src/backend/optimizer/util/pathnode.c b/src/backend/optimizer/util/pathnode.c
index 43db1bd267f..f424fd0dc4a 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.32 1999/02/12 02:37:52 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/optimizer/util/pathnode.c,v 1.33 1999/02/12 05:56:57 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -159,12 +159,21 @@ better_path(Path *new_path, List *unique_paths, bool *is_new)
List *temp = NIL;
int better_key;
int better_sort;
-
+
+#ifdef OPTDUP_DEBUG
+ printf("better_path entry\n");
+ printf("new\n");
+ pprint(new_path);
+ printf("unique_paths\n");
+ pprint(unique_paths);
+#endif
+
foreach(temp, unique_paths)
{
path = (Path *) lfirst(temp);
-#ifdef OPTDUP_DEBUG
+#if 0
+/*def OPTDUP_DEBUG*/
if (!pathkeys_match(new_path->pathkeys, path->pathkeys, &better_key) ||
better_key != 0)
{
@@ -210,6 +219,13 @@ better_path(Path *new_path, List *unique_paths, bool *is_new)
(better_key != 2 && better_sort == 1)) &&
new_path->path_cost <= path->path_cost))
{
+#ifdef OPTDUP_DEBUG
+ printf("replace with new %p old %p better key %d better sort %d\n", &new_path, &path, better_key, better_sort);
+ printf("old\n");
+ pprint(path);
+ printf("new\n");
+ pprint(new_path);
+#endif
*is_new = false;
return path;
}
@@ -223,12 +239,12 @@ better_path(Path *new_path, List *unique_paths, bool *is_new)
(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);
+#ifdef OPTDUP_DEBUG
+ printf("skip new %p old %p better key %d better sort %d\n", &new_path, &path, better_key, better_sort);
printf("old\n");
pprint(path);
+ printf("new\n");
+ pprint(new_path);
#endif
*is_new = false;
return NULL;
@@ -236,6 +252,12 @@ better_path(Path *new_path, List *unique_paths, bool *is_new)
}
}
+#ifdef OPTDUP_DEBUG
+ printf("add new %p old %p better key %d better sort %d\n", &new_path, &path, better_key, better_sort);
+ printf("new\n");
+ pprint(new_path);
+#endif
+
*is_new = true;
return NULL;
}
diff --git a/src/backend/optimizer/util/relnode.c b/src/backend/optimizer/util/relnode.c
index 9706f654ebf..fd474f65c07 100644
--- a/src/backend/optimizer/util/relnode.c
+++ b/src/backend/optimizer/util/relnode.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/optimizer/util/relnode.c,v 1.11 1999/02/09 17:03:01 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/optimizer/util/relnode.c,v 1.12 1999/02/12 05:56:58 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -45,7 +45,6 @@ get_base_rel(Query *root, int relid)
rel->width = 0;
rel->targetlist = NIL;
rel->pathlist = NIL;
- rel->unorderedpath = (Path *) NULL;
rel->cheapestpath = (Path *) NULL;
rel->pruneable = true;
rel->classlist = NULL;