Received: from localhost (unknown [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 058532E0078 for ; Thu, 21 Feb 2008 17:10:28 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 05070-04 for ; Thu, 21 Feb 2008 17:10:21 -0400 (AST) Received: from an-out-0708.google.com (an-out-0708.google.com [209.85.132.250]) by postgresql.org (Postfix) with ESMTP id 1AC932E005B for ; Thu, 21 Feb 2008 17:10:25 -0400 (AST) Received: by an-out-0708.google.com with SMTP id c36so46118ana.33 for ; Thu, 21 Feb 2008 13:10:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=uIGFSlZqJ80RynutzrtY2kHas1S/SK+vzv/YZ3KnYho=; b=P9wwP6tlHbUhR/RKvppDhlngZBG8xd6g7/DZGyRr8M7cBn13vSvgUqiZFzDPQUrSwnYpdcGcT1/4DDsd6nEiHddTEOks3vLfK2N2IijNf99By//KQVRXNWFqNLriGtl/2Fn3k0sexEDM49+hIh1fQDHbRBa9LjTdoes3R2Ih7Mc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=XMxW+JOwzltX+/OfO20P6Oj0bEGFqRFhduAkKUmFHlNXWb/EsPshNkV37WW4coGkwI64VPV1usTYOoSOCzY/vOhbbQ3uf+DRA2MDe2Xuc92VpWo+GrtSTyqPjCgpXzjyQyg0UXsfVvl3u03CGswtaH7drlaLwY4InwuDt9b0/wA= Received: by 10.100.152.19 with SMTP id z19mr21054478and.56.1203628224164; Thu, 21 Feb 2008 13:10:24 -0800 (PST) Received: by 10.100.228.15 with HTTP; Thu, 21 Feb 2008 13:10:24 -0800 (PST) Message-ID: Date: Thu, 21 Feb 2008 22:10:24 +0100 From: "Claus Guttesen" To: "Adonias Malosso" Subject: Re: 4s query want to run faster Cc: pgsql-performance@postgresql.org In-Reply-To: <8a5d3c890802211248k7d9dfbb5ndd645358a84130a7@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <8a5d3c890802211248k7d9dfbb5ndd645358a84130a7@mail.gmail.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200802/273 X-Sequence-Number: 28815 > The following query takes about 4s to run in a 16GB ram server. Any ideas > why it doesn=B4t use index for the primary keys in the join conditions? Maby random_page_cost is set too high? What version are you using? --=20 regards Claus When lenity and cruelty play for a kingdom, the gentlest gamester is the soonest winner. Shakespeare