From: | Scott Mead <scottm(at)openscg(dot)com> |
---|---|
To: | "Shulgin, Oleksandr" <oleksandr(dot)shulgin(at)zalando(dot)de> |
Cc: | 許耀彰 <kpm906(at)gmail(dot)com>, pgsql-general(at)postgresql(dot)org |
Subject: | Re: [BUGS] postgresql table data control |
Date: | 2015-10-19 22:26:35 |
Message-ID: | B5F8D346-60B8-4E6C-87B4-ACC06D15D993@openscg.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-bugs pgsql-general |
> On Oct 19, 2015, at 04:29, Shulgin, Oleksandr <oleksandr(dot)shulgin(at)zalando(dot)de> wrote:
>
>> On Sat, Oct 17, 2015 at 1:26 AM, 許耀彰 <kpm906(at)gmail(dot)com> wrote:
>> Dear Support Team,
>> How can we know each table data increase day by day? It mean how do we get how many data produce today,included which data? Thank you.
>
>
> [moving from bugs(at)]
>
> Please refer to these SQL-level functions:
>
> pg_relation_size()
> pg_total_relation_size()
> pg_size_pretty()
If you are looking to track this over time, you'll need to use a tool that is capturing this in snapshots and do some reporting over it.
I've written a script that I use frequently as part of my OpenWatch tool (https://bitbucket.org/scott_mead/openwatch/src/d024185b1b5585f7b4c8a5ad6b926eafed2e249e/bindings/java/sql/OpenWatch-Snapshots.sql?at=master&fileviewer=file-view-default) Run this script in the database, then run snapshots periodically:
Select snapshots.save_snap();
To see a size report between snapshots, list the available snapshots:
select * from list_snaps();
To get the size report, get the snap_id numbers you want to report between and run:
select * from snapshots.report_tables(<startsnapid>, <endsnapid>)
If you download the full OpenWatch tool (https://bitbucket.org/scott_mead/openwatch/downloads) and run it from the shell script, you an add cpu, disk/io and memory to the report as well.
>
> http://www.postgresql.org/docs/current/static/functions-admin.html
>
From | Date | Subject | |
---|---|---|---|
Next Message | 許耀彰 | 2015-10-19 23:07:32 | database and table information collect |
Previous Message | Tom Lane | 2015-10-19 21:57:40 | Re: BUG #13687: bug in row_to_json function with '-infinity' timestamp |
From | Date | Subject | |
---|---|---|---|
Next Message | Dane Foster | 2015-10-20 02:23:23 | Returning JSON or JSONB |
Previous Message | John R Pierce | 2015-10-19 21:18:09 | Re: Are there any major benefits to using point and not real data type |