Shorn
Shorn

Reputation: 21496

Postgres: Can I identify which tables are write-heavy in a schema using the statistics?

I'm trying to identify which tables in our schema see the heaviest insert/update load.

Is there a way to easily count the number of inserts/updates that have been issued on a specific table within a specific time range?

Upvotes: 2

Views: 541

Answers (1)

Laurenz Albe
Laurenz Albe

Reputation: 247270

You can use pg_stat_user_tables for that.

Use pg_stat_reset() to reset the statistics, then wait a while.

The columns starting with n_ will tell you which tables receive the most writes.

Upvotes: 1

Related Questions