pgstattuple query performance

2024-01-02T09:36:22.63+00:00

I am trying to build the query that checks dead tuples, live tuples percent, free space etc., in all my users tables using pgstattuple extension. Can you please help me with the query? Just FYI., there are couple of large tables with more than 100GB of size.

Azure Database for PostgreSQL
{count} votes

Accepted answer
  1. GeethaThatipatri-MSFT 29,542 Reputation points Microsoft Employee Moderator
    2024-01-02T17:33:47.9866667+00:00

    Hi, @Naveen Kumar Kakarla (Quadrant Resource) Thanks for posting your question in the Microsoft Q&A forum.

    Here is the blog post provides a detailed explanation of how to use pgstattuple to get tuple-level statistics for PostgreSQL tables, including dead tuples, live tuples, free space, and more.

    https://www.percona.com/blog/postgresql-tuple-level-statistics-with-pgstattuple/

    The blog post also includes examples of queries that you can use to get statistics for individual tables or for all tables in a database. These queries can be useful for identifying table bloat and optimizing database performance.

    I hope this information helps! Let me know if you have any further questions.

    Regards

    Geetha


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.