Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can i check in Postgresql if specific index is loaded to memory?

Is there any way to check if index is loaded to memory?

like image 698
offline15 Avatar asked Feb 26 '23 03:02

offline15


1 Answers

Check the contrib module pg_buffercache

After installation you can use this query to see if the table and index are in the buffercache:

SELECT
    DISTINCT
    relname
FROM
    pg_buffercache
        JOIN pg_class USING (relfilenode)
WHERE
    relname IN('your_tablename','your_index_name'); 
like image 130
Frank Heikens Avatar answered Mar 05 '23 17:03

Frank Heikens