Re: Making planner skip hard-coded view values?
| От | Tom Lane |
|---|---|
| Тема | Re: Making planner skip hard-coded view values? |
| Дата | |
| Msg-id | 7898.1362713311@sss.pgh.pa.us обсуждение |
| Ответ на | Making planner skip hard-coded view values? (François Beausoleil <francois@teksol.info>) |
| Список | pgsql-general |
=?iso-8859-1?Q?Fran=E7ois_Beausoleil?= <francois@teksol.info> writes:
> I have a view similar to this (regression at end):
> CREATE VIEW published_reports AS
> SELECT true AS aired, *
> FROM published_aired_reports
> UNION ALL
> SELECT false AS aired, *
> FROM published_unaired_reports;
> Given that view definition, I expected a WHERE clause with the hard-coded value to ignore one of the tables:
> SELECT COUNT(*) FROM published_reports WHERE aired;
> This is on 9.1.3, but may have changed later.
Works for me. After a quick glance at the release notes, I think this was
fixed in 9.1.4:
* Fix planning of UNION ALL subqueries with output columns that are not simple variables (Tom Lane)
Planning of such cases got noticeably worse in 9.1 as a result of a misguided fix for "MergeAppend child's
targetlistdoesn't match MergeAppend" errors. Revert that fix and do it another way.
regards, tom lane
В списке pgsql-general по дате отправления: