Re: cost of CREATE VIEW ... AS SELECT DISTINCT

From: Scott Marlowe <smarlowe(at)g2switchworks(dot)com>
To: mailreg(at)numerixtechnology(dot)de
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: cost of CREATE VIEW ... AS SELECT DISTINCT
Date: 2005-03-28 22:04:23
Message-ID: 1112047463.22988.25.camel@state.g2switchworks.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Mon, 2005-03-28 at 15:43, T E Schmitz wrote:
> Hello,
> How expensive would it be to maintain the following VIEW:
>
> CREATE VIEW origin AS SELECT DISTINCT origin FROM transaktion
>
> if there is in index on transaktion.origin; the table transaktion has
> thousands of records and there are only a few distinct origin?

The cost will only be encurred when running the view. if you want
materialized views (which WOULD have maintenance costs) you'll have to
do a google search for postgresql materialized views and implement them
by hand, so to speak.

The cost of executing that view should be the same as the cost of
running the query by hand.

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Neil Conway 2005-03-29 07:59:44 Re: Executing Anonymous Blocks
Previous Message T E Schmitz 2005-03-28 21:43:09 cost of CREATE VIEW ... AS SELECT DISTINCT