pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Scott Marlowe <smarlowe@g2switchworks.com>
To: mailreg@numerixtechnology.de
Cc: pgsql-sql@postgresql.org
Subject: Re: cost of CREATE VIEW ...  AS SELECT DISTINCT
Date: Mon, 28 Mar 2005 16:04:23 -0600
Message-ID: <1112047463.22988.25.camel@state.g2switchworks.com> (raw)
In-Reply-To: <42487A6D.6020506@numerixtechnology.de>
References: <42487A6D.6020506@numerixtechnology.de>

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.



view thread (12+ messages)  latest in thread

Message-ID: <1112047463.22988.25.camel@state.g2switchworks.com>
Permalink:  ../1112047463.22988.25.camel@state.g2switchworks.com/
Also on:    postgresql.org/message-id/1112047463.22988.25.camel@state.g2switchworks.com

 · 

reply

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-sql@postgresql.org
  Cc: smarlowe@g2switchworks.com, mailreg@numerixtechnology.de
  Subject: Re: cost of CREATE VIEW ...  AS SELECT DISTINCT
  In-Reply-To: <1112047463.22988.25.camel@state.g2switchworks.com>

* 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