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

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: T E Schmitz <mailreg(at)numerixtechnology(dot)de>
Cc: Scott Marlowe <smarlowe(at)g2switchworks(dot)com>, pgsql-sql(at)postgresql(dot)org
Subject: Re: cost of CREATE VIEW ... AS SELECT DISTINCT
Date: 2005-03-29 15:04:18
Message-ID: 20050329150418.GA32031@wolff.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Tue, Mar 29, 2005 at 14:21:15 +0100,
T E Schmitz <mailreg(at)numerixtechnology(dot)de> wrote:
>
> As far as I can see (via EXPLAIN), both DISTINCT and GROUP BY will lead
> to a sequentail scan. Is that correct?

If you need to read the whole table yes. However if you join the view
to something else that might not be necessary.

> If that's the case, I should come up with a different concept to obtain
> a list of ORIGINs.

That may be a good idea, especially if there are lots of rows for each
origin value.

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Bruno Wolff III 2005-03-29 15:07:10 Re: cost of CREATE VIEW ... AS SELECT DISTINCT
Previous Message T E Schmitz 2005-03-29 14:12:24 Re: cost of CREATE VIEW ... AS SELECT DISTINCT