Received: from localhost (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id D3FD663593A for ; Mon, 6 Apr 2009 11:03:31 -0300 (ADT) 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 06612-03 for ; Mon, 6 Apr 2009 11:03:26 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-ew0-f167.google.com (mail-ew0-f167.google.com [209.85.219.167]) by mail.postgresql.org (Postfix) with ESMTP id 6FB266352D1 for ; Mon, 6 Apr 2009 10:58:07 -0300 (ADT) Received: by ewy11 with SMTP id 11so2939393ewy.19 for ; Mon, 06 Apr 2009 06:58:05 -0700 (PDT) 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 :content-transfer-encoding; bh=/+KI1oClH3Fjp+wZGlZOf5f7AWfzod1i+Pzl1kLGK2A=; b=Ni0hZJ48L6++8dLURqgIh8yIwS9iCXawkJ/G0B9iviNHIzp76kuPgIMQ1ZrEfHKQ4Z NYSbwSJVrB9mwFXhC7ENjruFn7Lt7hzs6Hd3/1E5C9bJ7KgDdKS4JeyVyP1S2SdJ/qK1 oTafQWy69Esy9R/WF0t2qUPV1uWJH412XrFVU= 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:content-transfer-encoding; b=O3b1u0DAH+7EdoaXHY5Y0pOOwOpMQQYEJnj0EpWmTBLbxXI+OR68WWcqefvVawEZtC 9CZ1ZRaxpllTma4u5ruUtDLYA0ElGL0yKPZWnQO/obl7waj3ZC86vAb6W9Ro7Gdd/l1/ dl7tEd+j5RxMotUJkCg7iYoSFqKX9iaZ4bvYQ= MIME-Version: 1.0 Received: by 10.210.16.10 with SMTP id 10mr3354779ebp.35.1239026285460; Mon, 06 Apr 2009 06:58:05 -0700 (PDT) In-Reply-To: <49D9F39F.40106@megafon.hr> References: <49D0D237.7020308@megafon.hr> <3028.1238422571@sss.pgh.pa.us> <49D0E687.50605@megafon.hr> <49D9F39F.40106@megafon.hr> Date: Mon, 6 Apr 2009 07:58:05 -0600 Message-ID: Subject: Re: Forcing seq_scan off for large table joined with tiny table yeilds improved performance From: Scott Marlowe To: Mario Splivalo Cc: Tom Lane , pgsql-performance@postgresql.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 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: 200904/128 X-Sequence-Number: 33495 On Mon, Apr 6, 2009 at 6:20 AM, Mario Splivalo wrote: > Scott Marlowe wrote: >> >> It's not really solved, it's just a happy coincidence that the current >> plan runs well. =A0In order to keep the query planner making good >> choices you need to increase stats target for the field in the index >> above. =A0The easiest way to do so is to do this: >> >> alter database mydb set default_statistics_target=3D100; >> >> and run analyze again: >> >> analyze; > > So, i removed the index on field_name, set default_default_statistics_tar= get > to 100, analyzed, and the results are the same: Why did you remove the index?