Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id D6DB2632D52 for ; Tue, 7 Jul 2009 21:58:33 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 01100-10 for ; Tue, 7 Jul 2009 21:58:23 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id 4941962F51F for ; Tue, 7 Jul 2009 21:58:23 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id n680wKx3003761; Tue, 7 Jul 2009 20:58:20 -0400 (EDT) To: Greg Stark cc: jacob@aers.ca, pgsql-sql@postgresql.org Subject: Re: FW: Query length limitation in postgres server > 8.2.9 In-reply-to: <407d949e0907071743u20025562w8141c824019a204f@mail.gmail.com> References: <6B5AF6293A289F45826220B17ABE7937FDB16C@BORON.aers.local> <407d949e0907071743u20025562w8141c824019a204f@mail.gmail.com> Comments: In-reply-to Greg Stark message dated "Wed, 08 Jul 2009 01:43:06 +0100" Date: Tue, 07 Jul 2009 20:58:20 -0400 Message-ID: <3760.1247014700@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200907/33 X-Sequence-Number: 32774 Greg Stark writes: > On Tue, Jul 7, 2009 at 11:33 PM, wrote: >> After some investigation it seems that the new server is refusing to use the index's but if I >> limit the number of arguments in the latter part of the statement to 100 then it works as >> expected in the expected amount of time using the indexs. > Ugh, I thought this sounded familiar. I think you're hitting this > limit which was put in place in 8.2.12 to protect against very slow > planning times for very long IN lists: Nonsense ... unless perhaps the index is partial, and the IN condition is relevant to proving it's legal to use the index? Given the lack of any schema information in the complaint, I suppose I can't rule that out, but one would hope the OP would have mentioned such a thing. regards, tom lane