Understanding pgstatindex - Mailing list pgsql-general

From Shlomi Marco
Subject Understanding pgstatindex
Date
Msg-id 46f0e0b5.0622300a.7976.1d87@mx.google.com
Whole thread Raw
List pgsql-general

Hey all.

 

When running pgstatindex(some_index) I'm getting the usual result:

Version, tree_level, index_size, root_block_no, internal_pages, leaf_pages, empty_pages, deleted_pages, avg_leaf_density, leaf_fragmentation

 

with a bunch of numbers.

Now, my question are

What each one represent (aside from the label), what exactly is "average leaf density" or "leaf fragmentation" or any other label?

And even more importantly, how can I make sense out of this number regarding my index?

 

I've been told that if "Leaf Frag" is above certain number, then reindex. But I'm looking for a more empirical approach.

Intuitively, I assume that an index state depends on many params that are somehow reflected by those numbers, and if I'll understand those, I could understand my indexes state better.

 

Thanks.

 

Shlomi.

 

pgsql-general by date:

Previous
From: "Shlomi Marco"
Date:
Subject: understanding pgstatindex
Next
From: Stefan Schwarzer
Date:
Subject: Calculate Weighted Aggregation between Two Tables