Re: BUG #5084: Query gives different number of rows depending on ORDER BY
| От | Andrew Gierth |
|---|---|
| Тема | Re: BUG #5084: Query gives different number of rows depending on ORDER BY |
| Дата | |
| Msg-id | 871vlqnals.fsf@news-spur.riddles.org.uk обсуждение исходный текст |
| Ответ на | Re: BUG #5084: Query gives different number of rows depending on ORDER BY (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>) |
| Ответы |
Re: BUG #5084: Query gives different number of rows depending on ORDER BY
|
| Список | pgsql-bugs |
> Bernt Marius Johnsen wrote:
>> Dump of the database:
To save anyone else the bother, there's a VASTLY simpler testcase for
this one, requiring no tables at all:
test1=# explain select * from (values (1),(null)) v(k) where k = k order by k;
QUERY PLAN
-------------------------------------------------------------------
Sort (cost=0.04..0.04 rows=2 width=4)
Sort Key: "*VALUES*".column1
-> Values Scan on "*VALUES*" (cost=0.00..0.03 rows=2 width=4)
(3 rows)
test1=# explain select * from (values (1),(null)) v(k) where k = k;
QUERY PLAN
-------------------------------------------------------------
Values Scan on "*VALUES*" (cost=0.00..0.03 rows=1 width=4)
Filter: (column1 = column1)
(2 rows)
Notice that the (k = k) qual is being dropped somewhere, which changes
the output since that's a disguised not-null condition.
--
Andrew (irc:RhodiumToad)
В списке pgsql-bugs по дате отправления: