pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Shaun Thomas <sthomas@peak6.com>
To: Kevin Grittner <Kevin.Grittner@wicourts.gov>
Cc: tgl@sss.pgh.pa.us <tgl@sss.pgh.pa.us>
Cc: tgarnett@panjiva.com <tgarnett@panjiva.com>
Cc: pgsql-performance@postgresql.org <pgsql-performance@postgresql.org>
Subject: Re: Re: Adding additional index causes 20,000x slowdown for certain select queries - postgres 9.0.3
Date: Wed, 16 Mar 2011 13:34:52 -0500
Message-ID: <4D8102CC.5060309@peak6.com> (raw)
In-Reply-To: <4D80B0AF020000250003B9B4@gw.wicourts.gov>
References: <4D80B076020000250003B9B1@gw.wicourts.gov>
	<4D80B0AF020000250003B9B4@gw.wicourts.gov>
	<4D80B0AF020000250003B9B4@gw.wicourts.gov>

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



view thread (15+ messages)  latest in thread

Message-ID: <4D8102CC.5060309@peak6.com>
Permalink:  ../4D8102CC.5060309@peak6.com/
Also on:    postgresql.org/message-id/4D8102CC.5060309@peak6.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: sthomas@peak6.com, Kevin.Grittner@wicourts.gov, tgl@sss.pgh.pa.us, tgarnett@panjiva.com
  Subject: Re: Re: Adding additional index causes 20,000x slowdown for certain select queries - postgres 9.0.3
  In-Reply-To: <4D8102CC.5060309@peak6.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox