Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 40CC11337BF8 for ; Wed, 16 Mar 2011 15:35:02 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 32031-01 for ; Wed, 16 Mar 2011 18:34:54 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from smtp2.peak6.com (smtp2.peak6.com [38.98.137.9]) by mail.postgresql.org (Postfix) with ESMTP id C35031337BF6 for ; Wed, 16 Mar 2011 15:34:53 -0300 (ADT) X-AuditID: 0a02cb1e-b7bf8ae00000096d-2c-4d8102ccc21d Message-ID: <4D8102CC.5060309@peak6.com> Date: Wed, 16 Mar 2011 13:34:52 -0500 From: Shaun Thomas Reply-To: sthomas@peak6.com Organization: Peak6 User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.7) Gecko/20100720 Lightning/1.0b2 Thunderbird/3.1.1 MIME-Version: 1.0 To: Kevin Grittner CC: "tgl@sss.pgh.pa.us" , "tgarnett@panjiva.com" , "pgsql-performance@postgresql.org" Subject: Re: Re: Adding additional index causes 20,000x slowdown for certain select queries - postgres 9.0.3 References: <4D80B076020000250003B9B1@gw.wicourts.gov> <4D80B0AF020000250003B9B4@gw.wicourts.gov> <4D80B0AF020000250003B9B4@gw.wicourts.gov> In-Reply-To: <4D80B0AF020000250003B9B4@gw.wicourts.gov> Content-Type: text/plain; charset="ISO-8859-1"; format=flowed content-transfer-encoding: 7bit X-Brightmail-Tracker: AAAAAQAAAZE= X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-10 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201103/171 X-Sequence-Number: 42850 On 03/16/2011 12:44 PM, Kevin Grittner wrote: > Well, that's one way of looking at it. Another would be that the > slower plan with the backward scan was only estimated to be 14.5% > less expensive than the fast plan, so a pretty moderate modifier > would have avoided this particular problem. I was wondering about that myself. Considering any backwards scan would necessarily be 10-100x slower than a forward scan unless the data was on an SSD, I assumed the planner was already using a multiplier to discourage its use. If not, it seems like a valid configurable. We set our random_page_cost to 1.5 once the DB was backed by NVRAM. I could see that somehow influencing precedence of a backwards index scan. But even then, SSDs and their ilk react more like RAM than even a large RAID... so should there be a setting that passes such useful info to the planner? Maybe a good attribute to associate with the tablespace, if nothing else. -- Shaun Thomas OptionsHouse | 141 W. Jackson Blvd. | Suite 800 | Chicago IL, 60604 312-676-8870 sthomas@peak6.com ______________________________________________ See http://www.peak6.com/email_disclaimer.php for terms and conditions related to this email