Re: order of clauses - Mailing list pgsql-general

From Peter Eisentraut
Subject Re: order of clauses
Date
Msg-id Pine.LNX.4.30.0102162156240.1009-100000@peter.localdomain
Whole thread Raw
In response to Re: order of clauses  ("Dan Wilson" <phpPgAdmin@acucore.com>)
Responses Re: order of clauses
List pgsql-general
Dan Wilson writes:

> : SELECT a.x/b.y FROM vals a, (SELECT y FROM vals WHERE y > 0) b WHERE (a.x
> : / b.y) > 1;
>
> How much of a performance hit is there when using a select in the FROM
> clause?  Is it even noticeable?  How much better is it to create a static
> view?

Subselects in FROM are currently not the most performance-encouraging way
to write a query (explicit JOINs might use more efficient plans), but
setting up a view is going to buy you zero because a query from a view is
just going to end up being processed like a subselect in FROM.

--
Peter Eisentraut      peter_e@gmx.net       http://yi.org/peter-e/


pgsql-general by date:

Previous
From: "Tim Barnard"
Date:
Subject: Re: Number of Connections
Next
From: Peter Eisentraut
Date:
Subject: Re: How to use gethostbyname()