pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Alexandre de Arruda Paes <adaldeia@gmail.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: PG using index+filter instead only use index
Date: Fri, 19 Mar 2010 15:49:22 -0400
Message-ID: <5135.1269028162@sss.pgh.pa.us> (raw)
In-Reply-To: <fe86db181003190645q3d93689bx1d76ad6ceea6ccdf@mail.gmail.com>
References: <fe86db181003190645q3d93689bx1d76ad6ceea6ccdf@mail.gmail.com>

Alexandre de Arruda Paes <adaldeia@gmail.com> writes:
> My question: if the cost is exactly the same, why PG choose the index
> ict13t2 on ct13t and apply a filter instead use the primary key ?

Why shouldn't it, if the estimated costs are the same?  You didn't
actually demonstrate they're the same though.

The cost estimates look a bit unusual to me; are you using nondefault
cost parameters, and if so what are they?

			regards, tom lane



view thread (4+ messages)  latest in thread

Message-ID: <5135.1269028162@sss.pgh.pa.us>
Permalink:  ../5135.1269028162@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/5135.1269028162@sss.pgh.pa.us

 · 

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: tgl@sss.pgh.pa.us, adaldeia@gmail.com
  Subject: Re: PG using index+filter instead only use index
  In-Reply-To: <5135.1269028162@sss.pgh.pa.us>

* 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