Received: from maia.hub.org (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id E90A7634B3A for ; Tue, 2 Feb 2010 07:04:02 -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 47870-10 for ; Tue, 2 Feb 2010 11:03:46 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-bw0-f213.google.com (mail-bw0-f213.google.com [209.85.218.213]) by mail.postgresql.org (Postfix) with ESMTP id 53789632FC1 for ; Tue, 2 Feb 2010 07:00:44 -0400 (AST) Received: by bwz5 with SMTP id 5so2146238bwz.3 for ; Tue, 02 Feb 2010 03:00:42 -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 :from:date:message-id:subject:to:content-type; bh=pD+DI5ztJyXXgXYx5iaO7+AlPE3Ts2on7qb7GpV78p4=; b=WoXswpeUs7D5LxzwI7CmL43wCB2K+cAR0OTInTWI99Ojm5R5EmM1mvAHkuszCyushu q24Z2mim/kiBSL84Wgj/KMXs11IW8ptMbJ29dRj6sRxDxOogw8IfIvWlv7YBLXukjGsR +e5BlRxB4WmE1bzmgk+jOAoATt97OKM6d4Sic= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=a5/0UWfSAbBSjNCSkHV/BUQeXLoRgpYj23cCjQWVL2rPBRGV/8vnMxa23iwUQ9ptxB oyLWo0PcBb3cFdLhiECBwGniBstSp4pxjnYGJvLYC12pMWDfVoZ/Z4ptubCdDnVMQsRC g+ZDKeNEzMmDAj0JKPc5eNYQ+Vp1jOpfGIhCg= MIME-Version: 1.0 Received: by 10.204.48.197 with SMTP id s5mr619415bkf.88.1265108442120; Tue, 02 Feb 2010 03:00:42 -0800 (PST) In-Reply-To: <20100202105641.GA5363@FlamingKaty.my.domain> References: <20100202105641.GA5363@FlamingKaty.my.domain> From: Ian Lea Date: Tue, 2 Feb 2010 11:00:22 +0000 Message-ID: <8c4e68611002020300t37c78ef0jc6a0d211cd95b8ef@mail.gmail.com> Subject: Re: How to increase postgresql performance To: pgsql-admin@postgresql.org Content-Type: text/plain; charset=ISO-8859-1 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/15 X-Sequence-Number: 33618 And maybe make sure that the id column is indexed, and see what EXPLAIN says. http://wiki.postgresql.org/wiki/Using_EXPLAIN -- Ian. On Tue, Feb 2, 2010 at 10:56 AM, Bret S. Lambert wrote: > 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 > > -- > Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-admin >