mirror of
https://github.com/postgres/postgres.git
synced 2025-04-24 10:47:04 +03:00
Copy-editing for GiST README.
This commit is contained in:
parent
79fae4a764
commit
1dd9b09332
@ -1,15 +1,19 @@
|
|||||||
$PostgreSQL: pgsql/src/backend/access/gist/README,v 1.1 2005/09/15 16:39:15 teodor Exp $
|
$PostgreSQL: pgsql/src/backend/access/gist/README,v 1.2 2005/09/15 17:44:27 neilc Exp $
|
||||||
|
|
||||||
This directory contains an implementation of GiST indexing for Postgres.
|
This directory contains an implementation of GiST indexing for Postgres.
|
||||||
|
|
||||||
GiST is stands for Generalized Search Tree. It was introduced in seminal paper
|
GiST stands for Generalized Search Tree. It was introduced in the seminal paper
|
||||||
"Generalized Search Trees for Database Systems", 1995, Joseph M. Hellerstein,
|
"Generalized Search Trees for Database Systems", 1995, Joseph M. Hellerstein,
|
||||||
Jeffrey F. Naughton,Avi Pfeffer (http://www.sai.msu.su/~megera/postgres/gist/papers/gist.ps) and implemented by J. Hellerstein and P.Aoki in early version of
|
Jeffrey F. Naughton, Avi Pfeffer:
|
||||||
PostgreSQL ( more details is available from The GiST Indexing Project at
|
|
||||||
Berkeley at http://gist.cs.berkeley.edu/). As an "university" project it had a
|
|
||||||
limited number of features and was in rare use.
|
|
||||||
|
|
||||||
Current implementation of GiST supports:
|
http://www.sai.msu.su/~megera/postgres/gist/papers/gist.ps
|
||||||
|
|
||||||
|
and implemented by J. Hellerstein and P. Aoki in an early version of
|
||||||
|
PostgreSQL (more details are available from The GiST Indexing Project
|
||||||
|
at Berkeley at http://gist.cs.berkeley.edu/). As a "university"
|
||||||
|
project it had a limited number of features and was in rare use.
|
||||||
|
|
||||||
|
The current implementation of GiST supports:
|
||||||
|
|
||||||
* Variable length keys
|
* Variable length keys
|
||||||
* Composite keys (multi-key)
|
* Composite keys (multi-key)
|
||||||
@ -17,34 +21,37 @@ Current implementation of GiST supports:
|
|||||||
* Concurrency
|
* Concurrency
|
||||||
* Recovery support via WAL logging
|
* Recovery support via WAL logging
|
||||||
|
|
||||||
Concurrence algoritms implemented in PostgreSQL were developed following paper
|
The support for concurrency implemented in PostgreSQL was developed based on the paper "Access Methods for Next-Generation Database Systems" by Marcel Kornaker:
|
||||||
"Access Methods for Next-Generation Database Systems" by Marcel Kornaker (http://www.sai.msu.su/~megera/postgres/gist/papers/concurrency/access-methods-for-next-generation.pdf.gz).
|
|
||||||
|
|
||||||
Original algorithms were modified by following reasons:
|
http://www.sai.msu.su/~megera/postgres/gist/papers/concurrency/access-methods-for-next-generation.pdf.gz
|
||||||
|
|
||||||
* They should be adapted to PostgreSQL conventions. For example, SEARCH
|
The original algorithms were modified in several ways:
|
||||||
|
|
||||||
|
* They should be adapted to PostgreSQL conventions. For example, the SEARCH
|
||||||
algorithm was considerably changed, because in PostgreSQL function search
|
algorithm was considerably changed, because in PostgreSQL function search
|
||||||
should return one tuple (next), not all tuples at once. Also, it should
|
should return one tuple (next), not all tuples at once. Also, it should
|
||||||
release page locks between calls.
|
release page locks between calls.
|
||||||
* since we added support of variable length keys, it's not possible to guarantee
|
* Since we added support for variable length keys, it's not possible to guarantee
|
||||||
enough free space for all keys on pages after splitting. User defined function
|
enough free space for all keys on pages after splitting. User defined function
|
||||||
picksplit doesn't have information about size of tuples (each tuple may
|
picksplit doesn't have information about size of tuples (each tuple may
|
||||||
contain several keys as in multicolumn index while picksplit could work with
|
contain several keys as in multicolumn index while picksplit could work with
|
||||||
only one key) and pages.
|
only one key) and pages.
|
||||||
* We modified original INSERT algorithm for perfomance reason. In particularly,
|
* We modified original INSERT algorithm for performance reason. In particular,
|
||||||
it's single-pass algorithm.
|
it is now a single-pass algorithm.
|
||||||
* Since the paper were theoretical, some details were omited and we have to find
|
* Since the papers were theoretical, some details were omitted and we
|
||||||
out ourself how to solve some specific problems.
|
have to find out ourself how to solve some specific problems.
|
||||||
|
|
||||||
Because of above reasons, we have to revised interaction of GiST core and
|
Because of the above reasons, we have to revised interaction of GiST
|
||||||
PostgreSQL WAL system. Moreover, we encountered (and solved) a problem of
|
core and PostgreSQL WAL system. Moreover, we encountered (and solved)
|
||||||
uncompleted insertions when recovering after crash, which was not touched in
|
a problem of uncompleted insertions when recovering after crash, which
|
||||||
the paper.
|
was not touched in the paper.
|
||||||
|
|
||||||
SEARCH ALGORITHM
|
SEARCH ALGORITHM
|
||||||
Function gettuple finds tuple, which satisfy search predicate. It store their
|
|
||||||
state and returns next tuple under subsequent calls. Stack contains page,
|
Function gettuple finds a tuple which satisfies the search
|
||||||
its LSN and LSN of parent page and currentposition is saved between calls.
|
predicate. It store their state and returns next tuple under
|
||||||
|
subsequent calls. Stack contains page, its LSN and LSN of parent page
|
||||||
|
and currentposition is saved between calls.
|
||||||
|
|
||||||
gettuple(search-pred)
|
gettuple(search-pred)
|
||||||
if ( firsttime )
|
if ( firsttime )
|
||||||
@ -90,8 +97,8 @@ Penalty is used for choosing a subtree to insert; method PickSplit is used for
|
|||||||
the node splitting algorithm; method Union is used for propagating changes
|
the node splitting algorithm; method Union is used for propagating changes
|
||||||
upward to maintain the tree properties.
|
upward to maintain the tree properties.
|
||||||
|
|
||||||
NOTICE: We modified original INSERT algorithm for perfomance reason. In
|
NOTICE: We modified original INSERT algorithm for performance reason. In
|
||||||
particularly, it's single-pass algorithm.
|
particularly, it is now a single-pass algorithm.
|
||||||
|
|
||||||
Function findLeaf is used to identify subtree for insertion. Page, in which
|
Function findLeaf is used to identify subtree for insertion. Page, in which
|
||||||
insertion is proceeded, is locked as well as its parent page. Functions
|
insertion is proceeded, is locked as well as its parent page. Functions
|
||||||
|
Loading…
x
Reference in New Issue
Block a user