mirror of
https://github.com/postgres/postgres.git
synced 2025-07-14 08:21:07 +03:00
Add operator strategy and comparison-value datatype fields to ScanKey.
Remove the 'strategy map' code, which was a large amount of mechanism that no longer had any use except reverse-mapping from procedure OID to strategy number. Passing the strategy number to the index AM in the first place is simpler and faster. This is a preliminary step in planned support for cross-datatype index operations. I'm committing it now since the ScanKeyEntryInitialize() API change touches quite a lot of files, and I want to commit those changes before the tree drifts under me.
This commit is contained in:
20
src/backend/utils/cache/lsyscache.c
vendored
20
src/backend/utils/cache/lsyscache.c
vendored
@ -7,7 +7,7 @@
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/cache/lsyscache.c,v 1.108 2003/10/04 18:22:59 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/cache/lsyscache.c,v 1.109 2003/11/09 21:30:37 tgl Exp $
|
||||
*
|
||||
* NOTES
|
||||
* Eventually, the index information should go through here, too.
|
||||
@ -53,21 +53,20 @@ op_in_opclass(Oid opno, Oid opclass)
|
||||
}
|
||||
|
||||
/*
|
||||
* op_requires_recheck
|
||||
* get_op_opclass_properties
|
||||
*
|
||||
* Return t if operator 'opno' requires a recheck when used as a
|
||||
* member of opclass 'opclass' (ie, this opclass is lossy for this
|
||||
* operator).
|
||||
* Get the operator's strategy number and recheck (lossy) flag
|
||||
* within the specified opclass.
|
||||
*
|
||||
* Caller should already have verified that opno is a member of opclass,
|
||||
* therefore we raise an error if the tuple is not found.
|
||||
*/
|
||||
bool
|
||||
op_requires_recheck(Oid opno, Oid opclass)
|
||||
void
|
||||
get_op_opclass_properties(Oid opno, Oid opclass,
|
||||
int *strategy, bool *recheck)
|
||||
{
|
||||
HeapTuple tp;
|
||||
Form_pg_amop amop_tup;
|
||||
bool result;
|
||||
|
||||
tp = SearchSysCache(AMOPOPID,
|
||||
ObjectIdGetDatum(opno),
|
||||
@ -77,10 +76,9 @@ op_requires_recheck(Oid opno, Oid opclass)
|
||||
elog(ERROR, "operator %u is not a member of opclass %u",
|
||||
opno, opclass);
|
||||
amop_tup = (Form_pg_amop) GETSTRUCT(tp);
|
||||
|
||||
result = amop_tup->amopreqcheck;
|
||||
*strategy = amop_tup->amopstrategy;
|
||||
*recheck = amop_tup->amopreqcheck;
|
||||
ReleaseSysCache(tp);
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user