> 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) -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs