Re: order of clauses

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Dan Wilson <phpPgAdmin(at)acucore(dot)com>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: order of clauses
Date: 2001-02-16 20:59:58
Message-ID: Pine.LNX.4.30.0102162156240.1009-100000@peter.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)gmx(dot)net http://yi.org/peter-e/

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Peter Eisentraut 2001-02-16 21:01:09 Re: How to use gethostbyname()
Previous Message Tom Lane 2001-02-16 20:58:22 Re: How to use gethostbyname()