diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2010-11-24 14:20:39 -0500 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2010-11-24 14:22:17 -0500 |
commit | 725d52d0c27cffe8c99bb78e2b0d2480d5cd702b (patch) | |
tree | 23aae31466c0f7e0e65762946b0012d30e92ab4d /src/backend/optimizer/util | |
parent | 4fc09ad00c3cc95003a5523d85999da1dd4f9d75 (diff) | |
download | postgresql-725d52d0c27cffe8c99bb78e2b0d2480d5cd702b.tar.gz postgresql-725d52d0c27cffe8c99bb78e2b0d2480d5cd702b.zip |
Create the system catalog infrastructure needed for KNNGIST.
This commit adds columns amoppurpose and amopsortfamily to pg_amop, and
column amcanorderbyop to pg_am. For the moment all the entries in
amcanorderbyop are "false", since the underlying support isn't there yet.
Also, extend the CREATE OPERATOR CLASS/ALTER OPERATOR FAMILY commands with
[ FOR SEARCH | FOR ORDER BY sort_operator_family ] clauses to allow the new
columns of pg_amop to be populated, and create pg_dump support for dumping
that information.
I also added some documentation, although it's perhaps a bit premature
given that the feature doesn't do anything useful yet.
Teodor Sigaev, Robert Haas, Tom Lane
Diffstat (limited to 'src/backend/optimizer/util')
-rw-r--r-- | src/backend/optimizer/util/plancat.c | 1 | ||||
-rw-r--r-- | src/backend/optimizer/util/predtest.c | 8 |
2 files changed, 6 insertions, 3 deletions
diff --git a/src/backend/optimizer/util/plancat.c b/src/backend/optimizer/util/plancat.c index 73132ddf5ca..908b4f7205d 100644 --- a/src/backend/optimizer/util/plancat.c +++ b/src/backend/optimizer/util/plancat.c @@ -212,6 +212,7 @@ get_relation_info(PlannerInfo *root, Oid relationObjectId, bool inhparent, info->relam = indexRelation->rd_rel->relam; info->amcostestimate = indexRelation->rd_am->amcostestimate; + info->amcanorderbyop = indexRelation->rd_am->amcanorderbyop; info->amoptionalkey = indexRelation->rd_am->amoptionalkey; info->amsearchnulls = indexRelation->rd_am->amsearchnulls; info->amhasgettuple = OidIsValid(indexRelation->rd_am->amgettuple); diff --git a/src/backend/optimizer/util/predtest.c b/src/backend/optimizer/util/predtest.c index 5ab4a31e152..d7ccba0a112 100644 --- a/src/backend/optimizer/util/predtest.c +++ b/src/backend/optimizer/util/predtest.c @@ -1661,8 +1661,9 @@ get_btree_test_op(Oid pred_op, Oid clause_op, bool refute_it) * From the same opfamily, find a strategy number for the clause_op, * if possible */ - clause_tuple = SearchSysCache2(AMOPOPID, + clause_tuple = SearchSysCache3(AMOPOPID, ObjectIdGetDatum(clause_op), + CharGetDatum(AMOP_SEARCH), ObjectIdGetDatum(opfamily_id)); if (HeapTupleIsValid(clause_tuple)) { @@ -1677,8 +1678,9 @@ get_btree_test_op(Oid pred_op, Oid clause_op, bool refute_it) } else if (OidIsValid(clause_op_negator)) { - clause_tuple = SearchSysCache2(AMOPOPID, - ObjectIdGetDatum(clause_op_negator), + clause_tuple = SearchSysCache3(AMOPOPID, + ObjectIdGetDatum(clause_op_negator), + CharGetDatum(AMOP_SEARCH), ObjectIdGetDatum(opfamily_id)); if (HeapTupleIsValid(clause_tuple)) { |