pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feedMaterialized View Estimation in Postgres
2+ messages / 2 participants
[nested] [flat]
* Materialized View Estimation in Postgres
@ 2020-04-15 18:13 Sahul Hameed <mail2shameed@gmail.com>
0 siblings, 1 reply; 2+ messages in thread
From: Sahul Hameed @ 2020-04-15 18:13 UTC (permalink / raw)
To: pgsql-admin
Team,
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.
Thanks and regards,
Sahul Hameed
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: Materialized View Estimation in Postgres
@ 2020-04-15 20:52 Thomas Kellerer <shammat@gmx.net>
parent: Sahul Hameed <mail2shameed@gmail.com>
0 siblings, 0 replies; 2+ messages in thread
From: Thomas Kellerer @ 2020-04-15 20:52 UTC (permalink / raw)
To: pgsql-admin@lists.postgresql.org
> 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;
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2020-04-15 20:52 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2020-04-15 18:13 Materialized View Estimation in Postgres Sahul Hameed <mail2shameed@gmail.com>
2020-04-15 20:52 ` Thomas Kellerer <shammat@gmx.net>
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