Re: Materialized View Estimation in Postgres - Mailing list pgsql-admin

From Thomas Kellerer
Subject Re: Materialized View Estimation in Postgres
Date
Msg-id 57c9152b-85bf-6b9e-d1e2-8f0278882596@gmx.net
Whole thread Raw
In response to Materialized View Estimation in Postgres  (Sahul Hameed <mail2shameed@gmail.com>)
List pgsql-admin
> 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;




pgsql-admin by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: user with autentication windows
Next
From: Devrim Gündüz
Date:
Subject: Re: pgAdmin4 dependency package "python3-psycopg2" should be placein "pgdg-common" repo.