From: Thomas Kellerer <shammat@gmx.net>
To: pgsql-admin@lists.postgresql.org
Subject: Re: Materialized View Estimation in Postgres
Date: Wed, 15 Apr 2020 22:52:35 +0200
Message-ID: <57c9152b-85bf-6b9e-d1e2-8f0278882596@gmx.net> (raw)
In-Reply-To: <CAGcyALSSu4zugUZ8_-iCpJONQQWCWHYx=5bbOF0tHj5f-J=E3g@mail.gmail.com>
References: <CAGcyALSSu4zugUZ8_-iCpJONQQWCWHYx=5bbOF0tHj5f-J=E3g@mail.gmail.com>
> I would like to know if there are any oracle equivalent of
> dbms_mview.estimate_mview_size in Postgres as we have been using it
> in Oracle for estimating required size for the upcoming mviews but
> after migration to Postgres we find it very hard to estimate the
> size.. Sometime our rds ran out of space and we had to spend lot of
> efforts and time to bring back the rds once after rds storage is
> exhausted. Or is there any other options available which can be used
> to estimate the size.
A very rough estimation could be to use pg_column_size() on the rows of your SELECT statement and aggregate that.
Despite it's name pg_column_size() also calculates the size of a complete row.
select sum(pg_column_size(mv))
from (
.... your select statement here ...
) mv;
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-admin@postgresql.org
Cc: shammat@gmx.net, pgsql-admin@lists.postgresql.org
Subject: Re: Materialized View Estimation in Postgres
In-Reply-To: <57c9152b-85bf-6b9e-d1e2-8f0278882596@gmx.net>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox