Received: from magus.postgresql.org ([87.238.57.229]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TH6Q4-00062B-EJ for pgsql-bugs@postgresql.org; Thu, 27 Sep 2012 05:13:52 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TH6Q2-0007M6-2C for pgsql-bugs@postgresql.org; Thu, 27 Sep 2012 05:13:52 +0000 Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.5/8.14.5) with ESMTP id q8R5Dm42016400; Thu, 27 Sep 2012 01:13:48 -0400 (EDT) From: Tom Lane To: Melese Tesfaye cc: pgsql-bugs@postgresql.org Subject: Re: BUG #7570: WHERE .. IN bug from 9.2.0 not fixed in 9.2.1 In-reply-to: References: <6567.1348701219@sss.pgh.pa.us> <14212.1348715864@sss.pgh.pa.us> Comments: In-reply-to Melese Tesfaye message dated "Thu, 27 Sep 2012 03:37:17 -0000" Date: Thu, 27 Sep 2012 01:13:48 -0400 Message-ID: <16399.1348722828@sss.pgh.pa.us> X-Pg-Spam-Score: -2.7 (--) X-Archive-Number: 201209/285 X-Sequence-Number: 34279 Melese Tesfaye writes: > [ test case ] Argh. The problem query has a plan like this: -> Merge Join (cost=1084.06..1354.58 rows=4 width=13) Merge Cond: (table2_t.pnr_id = a.pnr_id) -> stuff ... -> Index Scan using table1_t_pnr_id_idx5 on table1_t a (cost=0.00..12.60 rows=4 width=13) Index Cond: (pnr_id = ANY ('{1801,2056}'::integer[])) which means the indexscan has to support mark/restore calls. And it looks like I blew it on mark/restore support when I taught btree to handle =ANY conditions natively, http://git.postgresql.org/gitweb/?p=postgresql.git&a=commitdiff&h=9e8da0f75731aaa7605cf4656c21ea09e84d2eb1 Will look into fixing that tomorrow. In the meantime, you should be able to work around this with "set enable_mergejoin = off". regards, tom lane