Received: from localhost (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 5C55A64FD1A for ; Mon, 10 Nov 2008 14:23:54 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 45342-06 for ; Mon, 10 Nov 2008 14:23:54 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from smtp-out.neti.ee (smtp-out.neti.ee [194.126.126.37]) by mail.postgresql.org (Postfix) with ESMTP id 04C7E6500D5 for ; Mon, 10 Nov 2008 14:23:51 -0400 (AST) X-Virus-Scanned: Debian amavisd-new at estpak.ee Received: from Relayhost3.neti.ee (relayhost3.estpak.ee [88.196.174.169]) by MXR-8.estpak.ee (Postfix) with ESMTP id 805A5153D48; Mon, 10 Nov 2008 20:23:47 +0200 (EET) X-SMTP-Auth-NETI-Businesmail: no Received: from andrusnotebook (unknown [195.50.198.194]) by Relayhost3.neti.ee (Postfix) with SMTP id 325B4D551D; Mon, 10 Nov 2008 20:23:45 +0200 (EET) Message-ID: From: "Andrus" To: "Tom Lane" Cc: References: <7709.1226334545@sss.pgh.pa.us> In-Reply-To: <7709.1226334545@sss.pgh.pa.us> Subject: Re: Simple indexed IN query takes 40 seconds Date: Mon, 10 Nov 2008 20:23:41 +0200 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="windows-1257"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Windows Mail 6.0.6001.18000 X-MimeOLE: Produced By Microsoft MimeOLE V6.0.6001.18049 X-Archive-Number: 200811/67 X-Sequence-Number: 31798 Tom, > Using something newer than 8.1 would help. Thank you. If CREATE TEMP TABLE ids ( id int ) ON COMMIT DROP; is created, ids are added to this table and ids table is used in inner join insted of IN clause or IN clause is replaced with ... dokumnr IN ( SELECT id FROM ids ) ... , will this fix the issue in 8.1.4 ? Andrus.