提交 5ee276dc 编写于 作者: H Heikki Linnakangas

Remove unused code for UNIQUE_PATH_LIMIT1.

The code that used to create these paths was removed in commit d4ce0921,
but this was left behind.
上级 5cc93e2e
......@@ -1608,8 +1608,7 @@ cdbpath_dedup_fixup_unique(UniquePath *uniquePath, CdbpathDedupFixupContext *ctx
return CdbVisit_Walk; /* onward to visit the kids */
/* No action needed if data is trivially unique. */
if (uniquePath->umethod == UNIQUE_PATH_NOOP ||
uniquePath->umethod == UNIQUE_PATH_LIMIT1)
if (uniquePath->umethod == UNIQUE_PATH_NOOP)
return CdbVisit_Walk; /* onward to visit the kids */
/* Find set of relids for which subpath must produce row ids. */
......
......@@ -22,7 +22,6 @@
#include <math.h>
#include "catalog/pg_exttable.h"
#include "catalog/pg_type.h" /* INT8OID */
#include "access/skey.h"
#include "access/sysattr.h"
#include "catalog/pg_class.h"
......@@ -1052,26 +1051,6 @@ create_unique_plan(PlannerInfo *root, UniquePath *best_path)
if (best_path->umethod == UNIQUE_PATH_NOOP)
return subplan;
/* CDB: Result will surely be unique if we produce only its first row. */
if (best_path->umethod == UNIQUE_PATH_LIMIT1)
{
Limit *limitplan;
/* Top off the subplan with a LIMIT 1 node. */
limitplan = makeNode(Limit);
copy_path_costsize(root, &limitplan->plan, &best_path->path);
limitplan->plan.targetlist = subplan->targetlist;
limitplan->plan.qual = NIL;
limitplan->plan.lefttree = subplan;
limitplan->plan.righttree = NULL;
limitplan->limitOffset = NULL;
limitplan->limitCount = (Node *) makeConst(INT8OID, -1, InvalidOid,
sizeof(int64),
Int64GetDatum(1),
false, true);
return (Plan *) limitplan;
}
/*
* As constructed, the subplan has a "flat" tlist containing just the Vars
* needed here and at upper levels. The values we are supposed to
......
......@@ -1234,8 +1234,7 @@ typedef enum
{
UNIQUE_PATH_NOOP, /* input is known unique already */
UNIQUE_PATH_HASH, /* use hashing */
UNIQUE_PATH_SORT, /* use sorting */
UNIQUE_PATH_LIMIT1 /* CDB: take at most one row from the subpath */
UNIQUE_PATH_SORT /* use sorting */
} UniquePathMethod;
typedef struct UniquePath
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册