Received: from localhost (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 1E313650138 for ; Tue, 2 Dec 2008 10:37:58 -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 15576-03 for ; Tue, 2 Dec 2008 10:37:52 -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.44]) by mail.postgresql.org (Postfix) with ESMTP id 2F3C76500CD for ; Tue, 2 Dec 2008 10:37:52 -0400 (AST) Received: from localhost (localhost [127.0.0.1]) by MXR-13.estpak.ee (Postfix) with ESMTP id 1728D1AD91; Tue, 2 Dec 2008 16:37:48 +0200 (EET) X-Virus-Scanned: amavisd-new at !change-mydomain-variable!.example.com Received: from smtp-out.neti.ee ([127.0.0.1]) by localhost (MXR-1.estpak.ee [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id u7VFWMbu5iI5; Tue, 2 Dec 2008 16:37:47 +0200 (EET) Received: from Relayhost1.neti.ee (Relayhost1 [88.196.174.141]) by MXR-13.estpak.ee (Postfix) with ESMTP id 3E3402C2F8; Tue, 2 Dec 2008 16:37:47 +0200 (EET) X-SMTP-Auth-NETI-Businesmail: no Received: from andrusnotebook (unknown [195.50.198.194]) by Relayhost1.neti.ee (Postfix) with SMTP id 01A532A5E93; Tue, 2 Dec 2008 16:37:46 +0200 (EET) Message-ID: <95776070DDC841978DF8335DCF59D6BB@andrusnotebook> From: "Andrus" To: , "PFC" References: In-Reply-To: Subject: Re: analyzing intermediate query Date: Tue, 2 Dec 2008 16:37:37 +0200 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="utf-8"; reply-type=response 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-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: 200812/13 X-Sequence-Number: 32049 >> My list can contain 1 .. 100000 records and table contains 3000000 >> records and is growing. > > Ah. No IN(), then ;) > Temp table + ANALYZE seems your only option... In 8.3 or 8.4 I think that IN() or temp table produce exactly the same result. Andrus.