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
eb0d00a9
Commit
eb0d00a9
authored
May 15, 2005
by
Neil Conway
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Various style cleanups for GiST; no changes to functionality.
parent
c9a382b2
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
35 deletions
+31
-35
src/backend/access/gist/gist.c
src/backend/access/gist/gist.c
+31
-35
No files found.
src/backend/access/gist/gist.c
View file @
eb0d00a9
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
* Portions Copyright (c) 1994, Regents of the University of California
*
*
* IDENTIFICATION
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/access/gist/gist.c,v 1.11
4 2005/05/11 06:24:50
neilc Exp $
* $PostgreSQL: pgsql/src/backend/access/gist/gist.c,v 1.11
5 2005/05/15 04:08:29
neilc Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -25,9 +25,9 @@
...
@@ -25,9 +25,9 @@
#undef GIST_PAGEADDITEM
#undef GIST_PAGEADDITEM
#define ATTSIZE(
datum, TupDesc, i, isnull
) \
#define ATTSIZE(
datum, TupDesc, i, isnull
) \
( \
( \
(
isnull
) ? 0 : \
(
isnull
) ? 0 : \
att_addlength(0, (TupDesc)->attrs[(i)-1]->attlen, (datum)) \
att_addlength(0, (TupDesc)->attrs[(i)-1]->attlen, (datum)) \
)
)
...
@@ -45,7 +45,7 @@
...
@@ -45,7 +45,7 @@
* and gistadjsubkey only
* and gistadjsubkey only
*/
*/
#define FILLITEM(evp, isnullkey, okey, okeyb, rkey, rkeyb) do { \
#define FILLITEM(evp, isnullkey, okey, okeyb, rkey, rkeyb) do { \
if (
isnullkey
) { \
if (
isnullkey
) { \
gistentryinit((evp), rkey, r, NULL, \
gistentryinit((evp), rkey, r, NULL, \
(OffsetNumber) 0, rkeyb, FALSE); \
(OffsetNumber) 0, rkeyb, FALSE); \
} else { \
} else { \
...
@@ -87,8 +87,7 @@ static OffsetNumber gistwritebuffer(Relation r,
...
@@ -87,8 +87,7 @@ static OffsetNumber gistwritebuffer(Relation r,
IndexTuple
*
itup
,
IndexTuple
*
itup
,
int
len
,
int
len
,
OffsetNumber
off
);
OffsetNumber
off
);
static
int
gistnospace
(
Page
page
,
static
bool
gistnospace
(
Page
page
,
IndexTuple
*
itvec
,
int
len
);
IndexTuple
*
itvec
,
int
len
);
static
IndexTuple
*
gistreadbuffer
(
Buffer
buffer
,
int
*
len
);
static
IndexTuple
*
gistreadbuffer
(
Buffer
buffer
,
int
*
len
);
static
IndexTuple
*
gistjoinvector
(
static
IndexTuple
*
gistjoinvector
(
IndexTuple
*
itvec
,
int
*
len
,
IndexTuple
*
itvec
,
int
*
len
,
...
@@ -107,14 +106,13 @@ static void gistadjsubkey(Relation r,
...
@@ -107,14 +106,13 @@ static void gistadjsubkey(Relation r,
GIST_SPLITVEC
*
v
,
GIST_SPLITVEC
*
v
,
GISTSTATE
*
giststate
);
GISTSTATE
*
giststate
);
static
IndexTuple
gistFormTuple
(
GISTSTATE
*
giststate
,
static
IndexTuple
gistFormTuple
(
GISTSTATE
*
giststate
,
Relation
r
,
Datum
attdata
[],
int
datumsize
[],
bool
isnull
[]
);
Relation
r
,
Datum
*
attdata
,
int
*
datumsize
,
bool
*
isnull
);
static
IndexTuple
*
gistSplit
(
Relation
r
,
static
IndexTuple
*
gistSplit
(
Relation
r
,
Buffer
buffer
,
Buffer
buffer
,
IndexTuple
*
itup
,
IndexTuple
*
itup
,
int
*
len
,
int
*
len
,
GISTSTATE
*
giststate
);
GISTSTATE
*
giststate
);
static
void
gistnewroot
(
Relation
r
,
static
void
gistnewroot
(
Relation
r
,
IndexTuple
*
itup
,
int
len
);
IndexTuple
*
itup
,
int
len
);
static
void
GISTInitBuffer
(
Buffer
b
,
uint32
f
);
static
void
GISTInitBuffer
(
Buffer
b
,
uint32
f
);
static
OffsetNumber
gistchoose
(
Relation
r
,
Page
p
,
static
OffsetNumber
gistchoose
(
Relation
r
,
Page
p
,
IndexTuple
it
,
IndexTuple
it
,
...
@@ -131,8 +129,8 @@ static void gistcentryinit(GISTSTATE *giststate, int nkey,
...
@@ -131,8 +129,8 @@ static void gistcentryinit(GISTSTATE *giststate, int nkey,
OffsetNumber
o
,
int
b
,
bool
l
,
bool
isNull
);
OffsetNumber
o
,
int
b
,
bool
l
,
bool
isNull
);
static
void
gistDeCompressAtt
(
GISTSTATE
*
giststate
,
Relation
r
,
static
void
gistDeCompressAtt
(
GISTSTATE
*
giststate
,
Relation
r
,
IndexTuple
tuple
,
Page
p
,
OffsetNumber
o
,
IndexTuple
tuple
,
Page
p
,
OffsetNumber
o
,
GISTENTRY
attdata
[],
bool
decompvec
[],
bool
isnull
[]
);
GISTENTRY
*
attdata
,
bool
*
decompvec
,
bool
*
isnull
);
static
void
gistFreeAtt
(
Relation
r
,
GISTENTRY
attdata
[],
bool
decompvec
[]
);
static
void
gistFreeAtt
(
Relation
r
,
GISTENTRY
*
attdata
,
bool
*
decompvec
);
static
void
gistpenalty
(
GISTSTATE
*
giststate
,
int
attno
,
static
void
gistpenalty
(
GISTSTATE
*
giststate
,
int
attno
,
GISTENTRY
*
key1
,
bool
isNull1
,
GISTENTRY
*
key1
,
bool
isNull1
,
GISTENTRY
*
key2
,
bool
isNull2
,
GISTENTRY
*
key2
,
bool
isNull2
,
...
@@ -503,7 +501,7 @@ gistlayerinsert(Relation r, BlockNumber blkno,
...
@@ -503,7 +501,7 @@ gistlayerinsert(Relation r, BlockNumber blkno,
}
}
else
else
{
{
/* eno
gt
h space */
/* eno
ug
h space */
OffsetNumber
off
,
OffsetNumber
off
,
l
;
l
;
...
@@ -577,7 +575,7 @@ gistwritebuffer(Relation r, Page page, IndexTuple *itup,
...
@@ -577,7 +575,7 @@ gistwritebuffer(Relation r, Page page, IndexTuple *itup,
/*
/*
* Check space for itup vector on page
* Check space for itup vector on page
*/
*/
static
int
static
bool
gistnospace
(
Page
page
,
IndexTuple
*
itvec
,
int
len
)
gistnospace
(
Page
page
,
IndexTuple
*
itvec
,
int
len
)
{
{
unsigned
int
size
=
0
;
unsigned
int
size
=
0
;
...
@@ -934,7 +932,7 @@ gistunionsubkey(Relation r, GISTSTATE *giststate, IndexTuple *itvec, GIST_SPLITV
...
@@ -934,7 +932,7 @@ gistunionsubkey(Relation r, GISTSTATE *giststate, IndexTuple *itvec, GIST_SPLITV
}
}
/*
/*
* find group in vector with equ
i
al value
* find group in vector with equal value
*/
*/
static
int
static
int
gistfindgroup
(
GISTSTATE
*
giststate
,
GISTENTRY
*
valvec
,
GIST_SPLITVEC
*
spl
)
gistfindgroup
(
GISTSTATE
*
giststate
,
GISTENTRY
*
valvec
,
GIST_SPLITVEC
*
spl
)
...
@@ -949,7 +947,6 @@ gistfindgroup(GISTSTATE *giststate, GISTENTRY *valvec, GIST_SPLITVEC *spl)
...
@@ -949,7 +947,6 @@ gistfindgroup(GISTSTATE *giststate, GISTENTRY *valvec, GIST_SPLITVEC *spl)
* first key is always not null (see gistinsert), so we may not check
* first key is always not null (see gistinsert), so we may not check
* for nulls
* for nulls
*/
*/
for
(
i
=
0
;
i
<
spl
->
spl_nleft
;
i
++
)
for
(
i
=
0
;
i
<
spl
->
spl_nleft
;
i
++
)
{
{
if
(
spl
->
spl_idgrp
[
spl
->
spl_left
[
i
]])
if
(
spl
->
spl_idgrp
[
spl
->
spl_left
[
i
]])
...
@@ -1007,8 +1004,7 @@ gistadjsubkey(Relation r,
...
@@ -1007,8 +1004,7 @@ gistadjsubkey(Relation r,
IndexTuple
*
itup
,
/* contains compressed entry */
IndexTuple
*
itup
,
/* contains compressed entry */
int
*
len
,
int
*
len
,
GIST_SPLITVEC
*
v
,
GIST_SPLITVEC
*
v
,
GISTSTATE
*
giststate
GISTSTATE
*
giststate
)
)
{
{
int
curlen
;
int
curlen
;
OffsetNumber
*
curwpos
;
OffsetNumber
*
curwpos
;
...
@@ -1400,8 +1396,8 @@ GISTInitBuffer(Buffer b, uint32 f)
...
@@ -1400,8 +1396,8 @@ GISTInitBuffer(Buffer b, uint32 f)
/*
/*
*
* find entry with lowest penalty
* find entry with lowest penalty
*/
*/
static
OffsetNumber
static
OffsetNumber
gistchoose
(
Relation
r
,
Page
p
,
IndexTuple
it
,
/* it has compressed entry */
gistchoose
(
Relation
r
,
Page
p
,
IndexTuple
it
,
/* it has compressed entry */
GISTSTATE
*
giststate
)
GISTSTATE
*
giststate
)
...
@@ -1643,12 +1639,12 @@ freeGISTstate(GISTSTATE *giststate)
...
@@ -1643,12 +1639,12 @@ freeGISTstate(GISTSTATE *giststate)
#ifdef GIST_PAGEADDITEM
#ifdef GIST_PAGEADDITEM
/*
/*
*
* Given an IndexTuple to be inserted on a page, this routine replaces
* Given an IndexTuple to be inserted on a page, this routine replaces
*
* the key with another key, which may involve generating a new IndexTuple
* the key with another key, which may involve generating a new IndexTuple
*
* if the sizes don't match or if the null status changes.
* if the sizes don't match or if the null status changes.
*
*
*
*
* XXX this only works for a single-column index tuple!
* XXX this only works for a single-column index tuple!
*/
*/
static
IndexTuple
static
IndexTuple
gist_tuple_replacekey
(
Relation
r
,
GISTENTRY
entry
,
IndexTuple
t
)
gist_tuple_replacekey
(
Relation
r
,
GISTENTRY
entry
,
IndexTuple
t
)
{
{
...
@@ -1690,8 +1686,8 @@ gist_tuple_replacekey(Relation r, GISTENTRY entry, IndexTuple t)
...
@@ -1690,8 +1686,8 @@ gist_tuple_replacekey(Relation r, GISTENTRY entry, IndexTuple t)
#endif
#endif
/*
/*
*
* initialize a GiST entry with a decompressed version of key
* initialize a GiST entry with a decompressed version of key
*/
*/
void
void
gistdentryinit
(
GISTSTATE
*
giststate
,
int
nkey
,
GISTENTRY
*
e
,
gistdentryinit
(
GISTSTATE
*
giststate
,
int
nkey
,
GISTENTRY
*
e
,
Datum
k
,
Relation
r
,
Page
pg
,
OffsetNumber
o
,
Datum
k
,
Relation
r
,
Page
pg
,
OffsetNumber
o
,
...
@@ -1719,8 +1715,8 @@ gistdentryinit(GISTSTATE *giststate, int nkey, GISTENTRY *e,
...
@@ -1719,8 +1715,8 @@ gistdentryinit(GISTSTATE *giststate, int nkey, GISTENTRY *e,
/*
/*
*
* initialize a GiST entry with a compressed version of key
* initialize a GiST entry with a compressed version of key
*/
*/
static
void
static
void
gistcentryinit
(
GISTSTATE
*
giststate
,
int
nkey
,
gistcentryinit
(
GISTSTATE
*
giststate
,
int
nkey
,
GISTENTRY
*
e
,
Datum
k
,
Relation
r
,
GISTENTRY
*
e
,
Datum
k
,
Relation
r
,
...
@@ -1790,7 +1786,7 @@ gistFormTuple(GISTSTATE *giststate, Relation r,
...
@@ -1790,7 +1786,7 @@ gistFormTuple(GISTSTATE *giststate, Relation r,
static
void
static
void
gistDeCompressAtt
(
GISTSTATE
*
giststate
,
Relation
r
,
IndexTuple
tuple
,
Page
p
,
gistDeCompressAtt
(
GISTSTATE
*
giststate
,
Relation
r
,
IndexTuple
tuple
,
Page
p
,
OffsetNumber
o
,
GISTENTRY
attdata
[],
bool
decompvec
[],
bool
isnull
[]
)
OffsetNumber
o
,
GISTENTRY
*
attdata
,
bool
*
decompvec
,
bool
*
isnull
)
{
{
int
i
;
int
i
;
Datum
datum
;
Datum
datum
;
...
@@ -1814,7 +1810,7 @@ gistDeCompressAtt(GISTSTATE *giststate, Relation r, IndexTuple tuple, Page p,
...
@@ -1814,7 +1810,7 @@ gistDeCompressAtt(GISTSTATE *giststate, Relation r, IndexTuple tuple, Page p,
}
}
static
void
static
void
gistFreeAtt
(
Relation
r
,
GISTENTRY
attdata
[],
bool
decompvec
[]
)
gistFreeAtt
(
Relation
r
,
GISTENTRY
*
attdata
,
bool
*
decompvec
)
{
{
int
i
;
int
i
;
...
...
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