From: | Jason W <jsonw(at)protonmail(dot)com> |
---|---|
To: | "pgsql-general(at)lists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org> |
Subject: | How to find out tables that are frequently read/ write? |
Date: | 2019-02-06 20:37:41 |
Message-ID: | AG-HMnOW9RXr_yjrTJCG6NvC4f2wFBjVKTqD1MABpGvbdNb5tBPF10nHZW3BwDUmyrazaEBr1ypXTJJqVSU09DPSczDAPgB-_wf9sLIfopc=@protonmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Apologize first because I am not familiar with database. So I probably did not find the right doc before posting my question.
I received a chart which is plotted by X - date, and Y - throughput (M/ sec). It shows that recently (after N Jan) the read/ write throughput was increased drastically.
So I lookup on the internet, finding doc like [1] points out that some pg_XXXXX tables, such as pg_stat_user_tables, looks like can be used to check such stats. For instance,
SELECT schemaname, relname, idx_tup_fetch + seq_tup_read as total_read
FROM pg_stat_user_tables
WHERE idx_tup_fetch is not NULL and idx_tup_fetch + seq_tup_read != 0
ORDER BY total_read desc
LIMIT 10;
Is this a correct way to find tables frequently being read? If not what's a better way to achieve this? And how about write? Or any other docs that I should read as well?
I appreciate any suggestions, thanks.
[1]. https://www.postgresql.org/docs/current/monitoring-stats.html
From | Date | Subject | |
---|---|---|---|
Next Message | Ricardo Martin Gomez | 2019-02-07 02:12:38 | Re: Connection issue |
Previous Message | Michel Pelletier | 2019-02-06 18:56:44 | Re: Implementing an expanded object in C |