Materialized View or table?

From: Johann Spies <johann(dot)spies(at)gmail(dot)com>
To: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Materialized View or table?
Date: 2015-09-15 07:14:02
Message-ID: CAGZ55DQ6v3k6z--z-nSRmxUzegckwGZ-PFO-q8awiLGsFJb5nw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I have a table (A) with 750+ million records and another one (B) which is a
summary of information in A containing 30+million records.

Now I wonder whether it wouldn't be better to have B as an indexed
materialized view. Though not often, there will be situations where B has
to be updated.

In the past I avoided materialized views when the result of a query
contains more than about 1 million records. I do not know enough about the
implications for the server's resources to make an informed decision though.

What are the pro's and con's of large materialized views vs. tables in a
case like this?

Regards
Johann
--
Because experiencing your loyal love is better than life itself,
my lips will praise you. (Psalm 63:3)

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jim Nasby 2015-09-15 07:22:58 Re: clone_schema function
Previous Message Jim Nasby 2015-09-15 07:04:05 Re: avoid lock conflict between SELECT and TRUNCATE