Re: cost of CREATE VIEW ... AS SELECT DISTINCT - Mailing list pgsql-sql

From Bruno Wolff III
Subject Re: cost of CREATE VIEW ... AS SELECT DISTINCT
Date
Msg-id 20050329150418.GA32031@wolff.to
Whole thread Raw
In response to Re: cost of CREATE VIEW ... AS SELECT DISTINCT  (T E Schmitz <mailreg@numerixtechnology.de>)
Responses Re: cost of CREATE VIEW ... AS SELECT DISTINCT  (T E Schmitz <mailreg@numerixtechnology.de>)
List pgsql-sql
On Tue, Mar 29, 2005 at 14:21:15 +0100, T E Schmitz <mailreg@numerixtechnology.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.


pgsql-sql by date:

Previous
From: T E Schmitz
Date:
Subject: Re: cost of CREATE VIEW ... AS SELECT DISTINCT
Next
From: Bruno Wolff III
Date:
Subject: Re: cost of CREATE VIEW ... AS SELECT DISTINCT