diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2003-11-12 21:15:59 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2003-11-12 21:15:59 +0000 |
commit | fa5c8a055a02e44f446e4593e397c33a572c4d67 (patch) | |
tree | 9c0a7ded5a88c082c28dbe2b431660813abd72b8 /src/backend/utils/cache/typcache.c | |
parent | 49f98fa833407b4e4252e42522e640ec8a0d08b2 (diff) |
Cross-data-type comparisons are now indexable by btrees, pursuant to my
pghackers proposal of 8-Nov. All the existing cross-type comparison
operators (int2/int4/int8 and float4/float8) have appropriate support.
The original proposal of storing the right-hand-side datatype as part of
the primary key for pg_amop and pg_amproc got modified a bit in the event;
it is easier to store zero as the 'default' case and only store a nonzero
when the operator is actually cross-type. Along the way, remove the
long-since-defunct bigbox_ops operator class.
Diffstat (limited to 'src/backend/utils/cache/typcache.c')
-rw-r--r-- | src/backend/utils/cache/typcache.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/backend/utils/cache/typcache.c b/src/backend/utils/cache/typcache.c index 9b7620b0f0a..12d295c5a59 100644 --- a/src/backend/utils/cache/typcache.c +++ b/src/backend/utils/cache/typcache.c @@ -33,7 +33,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/cache/typcache.c,v 1.2 2003/11/09 21:30:37 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/cache/typcache.c,v 1.3 2003/11/12 21:15:56 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -158,22 +158,26 @@ lookup_type_cache(Oid type_id, int flags) { if (typentry->btree_opc != InvalidOid) typentry->eq_opr = get_opclass_member(typentry->btree_opc, + InvalidOid, BTEqualStrategyNumber); if (typentry->eq_opr == InvalidOid && typentry->hash_opc != InvalidOid) typentry->eq_opr = get_opclass_member(typentry->hash_opc, + InvalidOid, HTEqualStrategyNumber); } if ((flags & TYPECACHE_LT_OPR) && typentry->lt_opr == InvalidOid) { if (typentry->btree_opc != InvalidOid) typentry->lt_opr = get_opclass_member(typentry->btree_opc, + InvalidOid, BTLessStrategyNumber); } if ((flags & TYPECACHE_GT_OPR) && typentry->gt_opr == InvalidOid) { if (typentry->btree_opc != InvalidOid) typentry->gt_opr = get_opclass_member(typentry->btree_opc, + InvalidOid, BTGreaterStrategyNumber); } if ((flags & (TYPECACHE_CMP_PROC | TYPECACHE_CMP_PROC_FINFO)) && @@ -181,6 +185,7 @@ lookup_type_cache(Oid type_id, int flags) { if (typentry->btree_opc != InvalidOid) typentry->cmp_proc = get_opclass_proc(typentry->btree_opc, + InvalidOid, BTORDER_PROC); } @@ -248,10 +253,10 @@ lookup_default_opclass(Oid type_id, Oid am_id) */ rel = heap_openr(OperatorClassRelationName, AccessShareLock); - ScanKeyEntryInitialize(&skey[0], 0, - Anum_pg_opclass_opcamid, - BTEqualStrategyNumber, F_OIDEQ, - ObjectIdGetDatum(am_id), OIDOID); + ScanKeyInit(&skey[0], + Anum_pg_opclass_opcamid, + BTEqualStrategyNumber, F_OIDEQ, + ObjectIdGetDatum(am_id)); scan = systable_beginscan(rel, OpclassAmNameNspIndex, true, SnapshotNow, 1, skey); |