Thread: How to see/calculate size of index in memory?

How to see/calculate size of index in memory?

From
"Sam R."
Date:

Hi!

I would have following question, if someone could help.

Question 1: How to see/calculate size of index in memory?
BTree, hash index.

I can see size of index e.g. with pg_relation_size FROM pg_class (after reindex). Does that tell size of index on disk?

I would be interested how big part of index is in memory. (Whole index?)

PG10/PG11.

Best Regards, Sam

Re: How to see/calculate size of index in memory?

From
Sergei Kornilov
Date:
Hello
You can use pg_buffercache contrib module: https://www.postgresql.org/docs/current/static/pgbuffercache.html

pg_relation_size - yes, its full size on disk regardless buffer cache

regards, Sergei