* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/access/gist/gist.c,v 1.89 2002/03/02 21:39:16 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/access/gist/gist.c,v 1.90 2002/03/05 05:30:31 momjian Exp $
*
*-------------------------------------------------------------------------
*/
Page page,
IndexTuple *itup,
int len,
- OffsetNumber off,
- GISTSTATE *giststate);
+ OffsetNumber off);
static int gistnospace(Page page,
IndexTuple *itvec, int len);
-static IndexTuple *gistreadbuffer(Relation r,
- Buffer buffer, int *len);
+static IndexTuple *gistreadbuffer(Buffer buffer, int *len);
static IndexTuple *gistjoinvector(
IndexTuple *itvec, int *len,
IndexTuple *additvec, int addlen);
int *len,
GISTSTATE *giststate,
InsertIndexResult *res);
-static void gistnewroot(GISTSTATE *giststate, Relation r,
+static void gistnewroot(Relation r,
IndexTuple *itup, int len);
static void GISTInitBuffer(Buffer b, uint32 f);
static OffsetNumber gistchoose(Relation r, Page p,
#ifdef GIST_PAGEADDITEM
/*
-** Take a compressed entry, and install it on a page. Since we now know
-** where the entry will live, we decompress it and recompress it using
-** that knowledge (some compression routines may want to fish around
-** on the page, for example, or do something special for leaf nodes.)
-*/
+ * Take a compressed entry, and install it on a page. Since we now know
+ * where the entry will live, we decompress it and recompress it using
+ * that knowledge (some compression routines may want to fish around
+ * on the page, for example, or do something special for leaf nodes.)
+ */
static OffsetNumber
gistPageAddItem(GISTSTATE *giststate,
Relation r,
ret = gistlayerinsert(r, GISTP_ROOT, &instup, &len, res, giststate);
if (ret & SPLITED)
- gistnewroot(giststate, r, instup, len);
+ gistnewroot(r, instup, len);
for (i = 0; i < len; i++)
pfree(instup[i]);
if (!(opaque->flags & F_LEAF))
{
/* internal page, so we must walk on tree */
- /* len IS equial 1 */
+ /* len IS equal 1 */
ItemId iid;
BlockNumber nblkno;
ItemPointerData oldtid;
oldlen;
ret |= SPLITED;
- itvec = gistreadbuffer(r, buffer, &tlen);
+ itvec = gistreadbuffer(buffer, &tlen);
itvec = gistjoinvector(itvec, &tlen, (*itup), *len);
oldlen = *len;
newitup = gistSplit(r, buffer, itvec, &tlen, giststate,
FirstOffsetNumber
:
OffsetNumberNext(PageGetMaxOffsetNumber(page));
- l = gistwritebuffer(r, page, (*itup), *len, off, giststate);
+ l = gistwritebuffer(r, page, (*itup), *len, off);
WriteBuffer(buffer);
/*
*/
static OffsetNumber
gistwritebuffer(Relation r, Page page, IndexTuple *itup,
- int len, OffsetNumber off, GISTSTATE *giststate)
+ int len, OffsetNumber off)
{
OffsetNumber l = InvalidOffsetNumber;
int i;
static int
gistnospace(Page page, IndexTuple *itvec, int len)
{
- int size = 0;
+ unsigned int size = 0;
int i;
for (i = 0; i < len; i++)
* Read buffer into itup vector
*/
static IndexTuple *
-gistreadbuffer(Relation r, Buffer buffer, int *len /* out */ )
+gistreadbuffer(Buffer buffer, int *len /* out */ )
{
OffsetNumber i,
maxoff;
{
OffsetNumber l;
- l = gistwritebuffer(r, right, rvectup, v.spl_nright, FirstOffsetNumber, giststate);
+ l = gistwritebuffer(r, right, rvectup, v.spl_nright, FirstOffsetNumber);
WriteBuffer(rightbuf);
if (res)
{
OffsetNumber l;
- l = gistwritebuffer(r, left, lvectup, v.spl_nleft, FirstOffsetNumber, giststate);
+ l = gistwritebuffer(r, left, lvectup, v.spl_nleft, FirstOffsetNumber);
if (BufferGetBlockNumber(buffer) != GISTP_ROOT)
PageRestoreTempPage(left, p);
}
static void
-gistnewroot(GISTSTATE *giststate, Relation r, IndexTuple *itup, int len)
+gistnewroot(Relation r, IndexTuple *itup, int len)
{
Buffer b;
Page p;
GISTInitBuffer(b, 0);
p = BufferGetPage(b);
- gistwritebuffer(r, p, itup, len, FirstOffsetNumber, giststate);
+ gistwritebuffer(r, p, itup, len, FirstOffsetNumber);
WriteBuffer(b);
}
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/access/gist/gistget.c,v 1.31 2001/10/25 05:49:20 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/access/gist/gistget.c,v 1.32 2002/03/05 05:30:31 momjian Exp $
*
*-------------------------------------------------------------------------
*/
static RetrieveIndexResult gistfirst(IndexScanDesc s, ScanDirection dir);
static RetrieveIndexResult gistnext(IndexScanDesc s, ScanDirection dir);
static ItemPointer gistheapptr(Relation r, ItemPointer itemp);
-static bool gistindex_keytest(IndexTuple tuple, TupleDesc tupdesc,
+static bool gistindex_keytest(IndexTuple tuple,
int scanKeySize, ScanKey key, GISTSTATE *giststate,
Relation r, Page p, OffsetNumber offset);
/* Similar to index_keytest, but decompresses the key in the IndexTuple */
static bool
gistindex_keytest(IndexTuple tuple,
- TupleDesc tupdesc,
int scanKeySize,
ScanKey key,
GISTSTATE *giststate,
{
it = (IndexTuple) PageGetItem(p, PageGetItemId(p, n));
if (gistindex_keytest(it,
- RelationGetDescr(s->relation),
s->numberOfKeys, s->keyData, giststate,
s->relation, p, n))
break;
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/access/gist/gistscan.c,v 1.40 2001/10/25 05:49:20 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/access/gist/gistscan.c,v 1.41 2002/03/05 05:30:35 momjian Exp $
*
*-------------------------------------------------------------------------
*/
static void gistdropscan(IndexScanDesc s);
static void gistadjone(IndexScanDesc s, int op, BlockNumber blkno,
OffsetNumber offnum);
-static void adjuststack(GISTSTACK *stk, BlockNumber blkno,
- OffsetNumber offnum);
+static void adjuststack(GISTSTACK *stk, BlockNumber blkno);
static void adjustiptr(IndexScanDesc s, ItemPointer iptr,
int op, BlockNumber blkno, OffsetNumber offnum);
if (op == GISTOP_SPLIT)
{
- adjuststack(so->s_stack, blkno, offnum);
- adjuststack(so->s_markstk, blkno, offnum);
+ adjuststack(so->s_stack, blkno);
+ adjuststack(so->s_markstk, blkno);
}
}
/*ARGSUSED*/
static void
adjuststack(GISTSTACK *stk,
- BlockNumber blkno,
- OffsetNumber offnum)
+ BlockNumber blkno)
{
while (stk != (GISTSTACK *) NULL)
{
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/access/rtree/Attic/rtscan.c,v 1.39 2001/10/25 05:49:21 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/access/rtree/Attic/rtscan.c,v 1.40 2002/03/05 05:30:40 momjian Exp $
*
*-------------------------------------------------------------------------
*/
static void rtdropscan(IndexScanDesc s);
static void rtadjone(IndexScanDesc s, int op, BlockNumber blkno,
OffsetNumber offnum);
-static void adjuststack(RTSTACK *stk, BlockNumber blkno,
- OffsetNumber offnum);
+static void adjuststack(RTSTACK *stk, BlockNumber blkno);
static void adjustiptr(IndexScanDesc s, ItemPointer iptr,
int op, BlockNumber blkno, OffsetNumber offnum);
if (op == RTOP_SPLIT)
{
- adjuststack(so->s_stack, blkno, offnum);
- adjuststack(so->s_markstk, blkno, offnum);
+ adjuststack(so->s_stack, blkno);
+ adjuststack(so->s_markstk, blkno);
}
}
/*ARGSUSED*/
static void
adjuststack(RTSTACK *stk,
- BlockNumber blkno,
- OffsetNumber offnum)
+ BlockNumber blkno)
{
while (stk != (RTSTACK *) NULL)
{