mirror of
https://github.com/postgres/postgres.git
synced 2025-11-07 19:06:32 +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:
@@ -7,14 +7,13 @@
|
||||
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $Id: rel.h,v 1.68 2003/09/24 18:54:01 tgl Exp $
|
||||
* $Id: rel.h,v 1.69 2003/11/09 21:30:38 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
#ifndef REL_H
|
||||
#define REL_H
|
||||
|
||||
#include "access/strat.h"
|
||||
#include "access/tupdesc.h"
|
||||
#include "catalog/pg_am.h"
|
||||
#include "catalog/pg_class.h"
|
||||
@@ -88,9 +87,8 @@ typedef struct TriggerDesc
|
||||
} TriggerDesc;
|
||||
|
||||
|
||||
/* ----------
|
||||
/*
|
||||
* Same for the statistics collector data in Relation and scan data.
|
||||
* ----------
|
||||
*/
|
||||
typedef struct PgStat_Info
|
||||
{
|
||||
@@ -138,9 +136,15 @@ typedef struct RelationData
|
||||
/* "struct HeapTupleData *" avoids need to include htup.h here */
|
||||
Form_pg_am rd_am; /* pg_am tuple for index's AM */
|
||||
|
||||
/* index access support info (used only for an index relation) */
|
||||
/*
|
||||
* index access support info (used only for an index relation)
|
||||
*
|
||||
* Note: only operators and support procs for the index's own datatype
|
||||
* are cached, not any cross-type operators. The arrays are indexed by
|
||||
* strategy or support number, which is a sufficient identifier given
|
||||
* that restriction.
|
||||
*/
|
||||
MemoryContext rd_indexcxt; /* private memory cxt for this stuff */
|
||||
IndexStrategy rd_istrat; /* operator strategy map */
|
||||
Oid *rd_operator; /* OIDs of index operators */
|
||||
RegProcedure *rd_support; /* OIDs of support procedures */
|
||||
struct FmgrInfo *rd_supportinfo; /* lookup info for support
|
||||
@@ -241,16 +245,6 @@ typedef Relation *RelationPtr;
|
||||
*/
|
||||
#define RelationGetDescr(relation) ((relation)->rd_att)
|
||||
|
||||
/*
|
||||
* RelationGetIndexStrategy
|
||||
* Returns index strategy for a relation.
|
||||
*
|
||||
* Note:
|
||||
* Assumes relation descriptor is valid.
|
||||
* Assumes relation descriptor is for an index relation.
|
||||
*/
|
||||
#define RelationGetIndexStrategy(relation) ((relation)->rd_istrat)
|
||||
|
||||
/*
|
||||
* RelationGetRelationName
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user