Received: from maia.hub.org (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 1A3EE632AEC for ; Tue, 2 Feb 2010 06:58:13 -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 46108-01 for ; Tue, 2 Feb 2010 10:57:53 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-ew0-f222.google.com (mail-ew0-f222.google.com [209.85.219.222]) by mail.postgresql.org (Postfix) with ESMTP id 83154632FC1 for ; Tue, 2 Feb 2010 06:56:45 -0400 (AST) Received: by ewy22 with SMTP id 22so638106ewy.34 for ; Tue, 02 Feb 2010 02:56:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:references:mime-version:content-type:content-disposition :in-reply-to:user-agent; bh=G+47w8gk7QsOOLyjIJPcO1UIWJ+x6UgDkD+Ea0Iqawo=; b=KCue5W6VBUXjiICX8z3vg0fqfTkjd6cdkmwLOM5b7X/W7Q5YCUgA7VhD9ga4Wc2IWo lBuHxKQtljTjX8yJjro7xs0sjnxfAsPz3igfjwuG2wR28FCpzDlH2Jvmy6guXkmp75tH SHJcGkAqB1HwZypkmgRbqbBWpB2MONyBHwbow= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=vg7qIOfbCfS39YsPisyBZ6Qm4rh+ipW4yyjhbq8McQ7sLIEGCde69bUSzjBshDg+2q Mm8lY21392Z35M+g18h4sFVDYV0kpCA7iUwAsyroKNv3OrlPjVTcMXRb4pCOYzr89y6W z9w4zGBwrQZCdmuCRF3EpULok6faFtCV+9fAE= Received: by 10.213.109.203 with SMTP id k11mr4453497ebp.47.1265108203648; Tue, 02 Feb 2010 02:56:43 -0800 (PST) Received: from localhost (cm-84.215.179.69.getinternet.no [84.215.179.69]) by mx.google.com with ESMTPS id 16sm4404409ewy.6.2010.02.02.02.56.42 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 02 Feb 2010 02:56:42 -0800 (PST) Date: Tue, 2 Feb 2010 11:56:41 +0100 From: "Bret S. Lambert" To: fida aljounaidi Cc: pgsql-admin@postgresql.org Subject: Re: How to increase postgresql performance Message-ID: <20100202105641.GA5363@FlamingKaty.my.domain> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.599 tagged_above=-10 required=5 tests=BAYES_00=-2.599 X-Spam-Level: X-Archive-Number: 201002/14 X-Sequence-Number: 33617 On Tue, Feb 02, 2010 at 11:51:57AM +0100, 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. Add a column to the table which denotes the characteristic that those 870 ids share, and select based on that? > > 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