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 <[EMAIL PROTECTED]> writes:
> 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'
[ experiments... ] Yes, if you spell it like this:
regression=# explain SELECT *