Received: from maia.hub.org (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 2C7F76331CB for ; Tue, 2 Feb 2010 19:34:20 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 21391-08 for ; Tue, 2 Feb 2010 23:33:54 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pz0-f175.google.com (mail-pz0-f175.google.com [209.85.222.175]) by mail.postgresql.org (Postfix) with ESMTP id 650C3632FE0 for ; Tue, 2 Feb 2010 19:34:09 -0400 (AST) Received: by pzk5 with SMTP id 5so484808pzk.29 for ; Tue, 02 Feb 2010 15:34:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type; bh=0qRH+ergGtBkDN4h8Lozs49/QodBwPpe4QYjKgBTMZY=; b=qWYX/Q/sYMaIb0FVKCx5pYoGqjbsG4L8zgX6KDhUWDbiGL3MUrFKNah1NmSFUldnj1 80LzuUKNdxtCNIU31sgi5KdJQhusa5uUnmTm2fyKf38f2LJIxfX0Mf+Ns3PKcGTRhFCW N7Ph3N+owrZLD0J73haFB6/BYPY1Ob5E1riXI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=E2s3Ujq1M2D2I5ZZAW3ZHs75crr3wvb2n3YxwXgqVNpQ1aVTd4lhB/Q3qrTIilPLJO 8pxYNYz0nz6eXLZQNbz0JTxA7s0PqEkW3qIrZRoj5LGDjegEQagCb3/iJojHv9Jt6s8B fMXVBBUBggatA3LHSLoLXQZM60cqpFeitjutE= MIME-Version: 1.0 Received: by 10.142.59.21 with SMTP id h21mr4394405wfa.182.1265153647747; Tue, 02 Feb 2010 15:34:07 -0800 (PST) In-Reply-To: References: Date: Wed, 3 Feb 2010 06:34:07 +0700 Message-ID: <99024f5f1002021534h7e7a04e4vc865c90b012aef6b@mail.gmail.com> Subject: Re: How to increase postgresql performance From: Kiswono Prayogo To: fida aljounaidi Cc: pgsql-admin@postgresql.org Content-Type: text/plain; charset=UTF-8 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.599 tagged_above=-10 required=5 tests=AWL=0.000, BAYES_00=-2.599 X-Spam-Level: X-Archive-Number: 201002/32 X-Sequence-Number: 33635 USE LEFT/JOIN instead of WHERE IN possibly would improve the performance.. On Tue, Feb 2, 2010 at 5:51 PM, fida aljounaidi wrote: > Hi > > I have an sql query which takes 20 seconds to be executed. > > this sql query contain more than 870 id under the select where in () > condition. > > So , it is not a large row result but a big list of conditions to be > crossed. > > I'm using postgresql 8.4. > > Thanks for help > > > -- Regards, Kiswono P GB