Question

Is it possible to create a B+ tree using Postgres?My requirement is that I need to create a B+ tree index on a certain column in the database.Associated with that node,there exists a key and whenever this particular node of the B+ tree is accessed I need to retrieve this key value. Is it possible to implement this using Postgres?Is it possible to export the index created using Postgres and store it in another index server?

Était-ce utile?

La solution

Are you using the term "B+tree" differently from "B-tree"? If so, the following link in the Postgres docs might be helpful: http://www.postgresql.org/docs/current/static/xindex.html. I have no experience at all creating custom indexes so I cannot say for certain if that link will be overly helpful to you or not.

Additionally in the docs: http://www.postgresql.org/about/, there is a section containing:

GiST (Generalized Search Tree) indexing is an advanced system which brings together a wide array of different sorting and searching algorithms including B-tree, B+-tree, R-tree, partial sum trees, ranked B+-trees and many others. It also provides an interface which allows both the creation of custom data types as well as extensible query methods with which to search them. Thus, GiST offers the flexibility to specify what you store, how you store it, and the ability to define new ways to search through it --- ways that far exceed those offered by standard B-tree, R-tree and other generalized search algorithms.

GiST serves as a foundation for many public projects that use PostgreSQL such as OpenFTS and PostGIS. OpenFTS (Open Source Full Text Search engine) provides online indexing of data and relevance ranking for database searching. PostGIS is a project which adds support for geographic objects in PostgreSQL, allowing it to be used as a spatial database for geographic information systems (GIS), much like ESRI's SDE or Oracle's Spatial extension.

So it appears you can extend or create your own b+tree index.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top