optimizer, view, union

From: Markus Bertheau <twanger(at)bluetwanger(dot)de>
To: pgsql-sql(at)postgresql(dot)org
Subject: optimizer, view, union
Date: 2005-06-23 17:31:57
Message-ID: 1119547917.7430.12.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hi,

Can pg transform

SELECT * FROM (
SELECT 'foo' AS class, id FROM foo
UNION ALL
SELECT 'bar' AS class, id FROM bar
) AS a WHERE class = 'foo'

into

SELECT 'foo' AS class, * FROM foo?

The subselect is a view here, that's why I don't just use the second
query.

Markus

--
Markus Bertheau <twanger(at)bluetwanger(dot)de>

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Thomas F. O'Connell 2005-06-23 19:16:36 Grouping Too Closely
Previous Message bumby 2005-06-23 17:03:07 Help with query, stuck :(