summaryrefslogtreecommitdiff
path: root/src/backend/optimizer/util
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2007-01-20 23:13:01 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2007-01-20 23:13:01 +0000
commitfcf4b146c697624a1b322def06db6b6aa1f1f481 (patch)
tree1af74f64a50c4f338dd2d3154e33a79bfb839caa /src/backend/optimizer/util
parentc82cc604f5cf860a12b95ce114311ba72854a536 (diff)
Simplify pg_am representation of ordering-capable access methods:
provide just a boolean 'amcanorder', instead of fields that specify the sort operator strategy numbers. We have decided to require ordering-capable AMs to use btree-compatible strategy numbers, so the old fields are overkill (and indeed misleading about what's allowed).
Diffstat (limited to 'src/backend/optimizer/util')
-rw-r--r--src/backend/optimizer/util/plancat.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/backend/optimizer/util/plancat.c b/src/backend/optimizer/util/plancat.c
index 9150f1d936f..e52943a675e 100644
--- a/src/backend/optimizer/util/plancat.c
+++ b/src/backend/optimizer/util/plancat.c
@@ -9,7 +9,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/optimizer/util/plancat.c,v 1.131 2007/01/09 02:14:13 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/optimizer/util/plancat.c,v 1.132 2007/01/20 23:13:01 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -190,8 +190,10 @@ get_relation_info(PlannerInfo *root, Oid relationObjectId, bool inhparent,
/*
* Fetch the ordering operators associated with the index, if any.
+ * We expect that all ordering-capable indexes use btree's
+ * strategy numbers for the ordering operators.
*/
- if (indexRelation->rd_am->amorderstrategy > 0)
+ if (indexRelation->rd_am->amcanorder)
{
int nstrat = indexRelation->rd_am->amstrategies;
@@ -203,17 +205,17 @@ get_relation_info(PlannerInfo *root, Oid relationObjectId, bool inhparent,
if (opt & INDOPTION_DESC)
{
- fwdstrat = indexRelation->rd_am->amdescorder;
- revstrat = indexRelation->rd_am->amorderstrategy;
+ fwdstrat = BTGreaterStrategyNumber;
+ revstrat = BTLessStrategyNumber;
}
else
{
- fwdstrat = indexRelation->rd_am->amorderstrategy;
- revstrat = indexRelation->rd_am->amdescorder;
+ fwdstrat = BTLessStrategyNumber;
+ revstrat = BTGreaterStrategyNumber;
}
/*
* Index AM must have a fixed set of strategies for it
- * to make sense to specify amorderstrategy, so we
+ * to make sense to specify amcanorder, so we
* need not allow the case amstrategies == 0.
*/
if (fwdstrat > 0)