Question

How can i know details about an index on postgresql like how many nodes, and tree height?

It is possible to access the data structure itself?

i havent found any catalog tables that exposes such that detailed information

Thanks in advance!

Était-ce utile?

La solution

See the bt_metap function in the pageinspect extension.

http://www.postgresql.org/docs/current/static/pageinspect.html

Autres conseils

You can use pgstattuple extension.

create extension pgstattuple;
SELECT * FROM pgstatindex('your_index_name');

For example,

ycsb=# select * from pgstatindex('usertable_pkey');
 version | tree_level | index_size | root_block_no | internal_pages | leaf_pages | empty_pages | deleted_pages | avg_leaf_density | leaf_fragmentation 
---------+------------+------------+---------------+----------------+------------+-------------+---------------+------------------+--------------------
       2 |          3 | 5488721920 |         44337 |           4464 |     665545 |           0 |             0 |               52 |                 11
(1 row)

You can refer to documentation; https://www.postgresql.org/docs/current/static/pgstattuple.html

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