Database Reference
In-Depth Information
To get the size of a table and an index, we can use the following:
SELECT pg_relation_size('table_name')
AS table_size,pg_relation_size('index_name') index_
size
FROM pg_tables WHERE table_name like 'table_name';
The GiST index
The Generalized Search Tree ( GiST ) index provides the possibility to create
custom data types with indexed access methods. It additionally provides an
extensive set of queries.
It can be utilized for operations beyond equivalent and range comparisons.
The GiST index is lossy, which means that it can create incorrect matches.
The syntax of the GiST index is as follows:
warehouse_db=# CREATE INDEX index_name ON table_name USING
gist(column_name);
Modules and extensions developed using GiST are rtree_gist ,
btree_gist , intarray , tsearch , ltree , and cube . Its complete
details can be found at the following link:
http://www.postgresql.org/docs/9.4/static/gist-
examples.html .
The GIN index
The GIN index can be introduced with the help of the following quote found at the
following link:
http://www.postgresql.org/docs/9.4/static/gin-intro.html
"GIN stands for Generalized Inverted Index. GIN is designed for handling cases
where the items to be indexed are composite values, and the queries to be handled by
the index need to search for element values that appear within the composite items.
For example, the items could be documents, and the queries could be searches for
documents containing speciic words"
Here is the syntax for the creation of a GIN index:
warehouse_db=# CREATE INDEX index_name ON table_name USING
gin(column_name);
 
Search WWH ::




Custom Search