Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
bfc308d1
Commit
bfc308d1
authored
Aug 26, 1996
by
Marc G. Fournier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Damn, we really need to clean up this "include file" dilemna...
include files *everywhere* ;(
parent
491b9b89
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
182 additions
and
0 deletions
+182
-0
src/backend/access/gist.h
src/backend/access/gist.h
+152
-0
src/backend/access/gistscan.h
src/backend/access/gistscan.h
+16
-0
src/backend/access/giststrat.h
src/backend/access/giststrat.h
+14
-0
No files found.
src/backend/access/gist.h
0 → 100644
View file @
bfc308d1
/*-------------------------------------------------------------------------
*
* gist.h--
* common declarations for the GiST access method code.
*
*
*
*
*
*-------------------------------------------------------------------------
*/
#ifndef GIST_H
#define GIST_H
#include "utils/rel.h"
#include "storage/off.h"
#include "storage/block.h"
#include "storage/bufpage.h"
#include "access/skey.h"
/*
** You can have as many strategies as you please in GiSTs, as
** long as your consistent method can handle them
*/
#define GISTNStrategies 100
/*
** Helper routines
*/
#define GISTNProcs 8
#define GIST_CONSISTENT_PROC 1
#define GIST_UNION_PROC 2
#define GIST_COMPRESS_PROC 3
#define GIST_DECOMPRESS_PROC 4
#define GIST_PENALTY_PROC 5
#define GIST_PICKSPLIT_PROC 6
#define GIST_EQUAL_PROC 7
#define GIST_INFO_PROC 8
#define F_LEAF (1 << 0)
typedef
struct
GISTPageOpaqueData
{
uint32
flags
;
}
GISTPageOpaqueData
;
typedef
GISTPageOpaqueData
*
GISTPageOpaque
;
#define GIST_LEAF(entry) (((GISTPageOpaque) PageGetSpecialPointer((entry)->page))->flags & F_LEAF)
/*
* When we descend a tree, we keep a stack of parent pointers.
*/
typedef
struct
GISTSTACK
{
struct
GISTSTACK
*
gs_parent
;
OffsetNumber
gs_child
;
BlockNumber
gs_blk
;
}
GISTSTACK
;
typedef
struct
GISTSTATE
{
func_ptr
consistentFn
;
func_ptr
unionFn
;
func_ptr
compressFn
;
func_ptr
decompressFn
;
func_ptr
penaltyFn
;
func_ptr
picksplitFn
;
func_ptr
equalFn
;
bool
haskeytype
;
bool
keytypbyval
;
}
GISTSTATE
;
/*
** When we're doing a scan, we need to keep track of the parent stack
** for the marked and current items.
*/
typedef
struct
GISTScanOpaqueData
{
struct
GISTSTACK
*
s_stack
;
struct
GISTSTACK
*
s_markstk
;
uint16
s_flags
;
struct
GISTSTATE
*
giststate
;
}
GISTScanOpaqueData
;
typedef
GISTScanOpaqueData
*
GISTScanOpaque
;
/*
** When we're doing a scan and updating a tree at the same time, the
** updates may affect the scan. We use the flags entry of the scan's
** opaque space to record our actual position in response to updates
** that we can't handle simply by adjusting pointers.
*/
#define GS_CURBEFORE ((uint16) (1 << 0))
#define GS_MRKBEFORE ((uint16) (1 << 1))
/* root page of a gist */
#define GISTP_ROOT 0
/*
** When we update a relation on which we're doing a scan, we need to
** check the scan and fix it if the update affected any of the pages it
** touches. Otherwise, we can miss records that we should see. The only
** times we need to do this are for deletions and splits. See the code in
** gistscan.c for how the scan is fixed. These two constants tell us what sort
** of operation changed the index.
*/
#define GISTOP_DEL 0
#define GISTOP_SPLIT 1
/*
** This is the Split Vector to be returned by the PickSplit method.
*/
typedef
struct
GIST_SPLITVEC
{
OffsetNumber
*
spl_left
;
/* array of entries that go left */
int
spl_nleft
;
/* size of this array */
char
*
spl_ldatum
;
/* Union of keys in spl_left */
OffsetNumber
*
spl_right
;
/* array of entries that go right */
int
spl_nright
;
/* size of the array */
char
*
spl_rdatum
;
/* Union of keys in spl_right */
}
GIST_SPLITVEC
;
/*
** An entry on a GiST node. Contains the key (pred), as well as
** its own location (rel,page,offset) which can supply the matching
** pointer. The size of the pred is in bytes, and leafkey is a flag to
** tell us if the entry is in a leaf node.
*/
typedef
struct
GISTENTRY
{
char
*
pred
;
Relation
rel
;
Page
page
;
OffsetNumber
offset
;
int
bytes
;
bool
leafkey
;
}
GISTENTRY
;
/*
** macro to initialize a GISTENTRY
*/
#define gistentryinit(e, pr, r, pg, o, b, l)\
{(e).pred = pr; (e).rel = r; (e).page = pg; (e).offset = o; (e).bytes = b; (e).leafkey = l;}
/* defined in gist.c */
extern
void
gistfreestack
(
GISTSTACK
*
s
);
extern
void
initGISTstate
(
GISTSTATE
*
giststate
,
Relation
index
);
extern
void
gistdentryinit
(
GISTSTATE
*
giststate
,
GISTENTRY
*
e
,
char
*
pr
,
Relation
r
,
Page
pg
,
OffsetNumber
o
,
int
b
,
bool
l
)
;
extern
void
gistcentryinit
(
GISTSTATE
*
giststate
,
GISTENTRY
*
e
,
char
*
pr
,
Relation
r
,
Page
pg
,
OffsetNumber
o
,
int
b
,
bool
l
)
;
#endif
/* GIST_H */
src/backend/access/gistscan.h
0 → 100644
View file @
bfc308d1
/*-------------------------------------------------------------------------
*
* gistscan.h--
* routines defined in access/gisr/gistscan.c
*
*
*
* rtscan.h,v 1.2 1995/06/14 00:06:58 jolly Exp
*
*-------------------------------------------------------------------------
*/
#ifndef GISTSCAN_H
void
gistadjscans
(
Relation
r
,
int
op
,
BlockNumber
blkno
,
OffsetNumber
offnum
);
#endif
/* GISTSCAN_H */
src/backend/access/giststrat.h
0 → 100644
View file @
bfc308d1
/*-------------------------------------------------------------------------
*
* giststrat.h--
* routines defined in access/gist/giststrat.c
*
*
*
* rtstrat.h,v 1.2 1995/02/12 02:54:51 andrew Exp
*
*-------------------------------------------------------------------------
*/
#ifndef GISTSTRAT_H
#endif
/* GISTSTRAT_H */
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment