pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Adnan DURSUN <a_dursun@hotmail.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Why does not perform index combination
Date: Thu, 16 Feb 2006 12:27:36 -0500
Message-ID: <29367.1140110856@sss.pgh.pa.us> (raw)
In-Reply-To: <BAY106-DAV1906100D639F6AE4BBA692FAFB0@phx.gbl>
References: <BAY106-DAV1906100D639F6AE4BBA692FAFB0@phx.gbl>

"Adnan DURSUN" <a_dursun@hotmail.com> writes:
>   I have query for a report. Explain analyze result is below. The =
> execution plan tells that it would use "t_koltuk_islem_pkey" index on =
> table "t_koltuk_islem" to scan. However, there is another index on table =
> "t_koltuk_islem" on column "islem_tarihi" that can be combined on plan. =
> Why doesn't optimizer choice that ? It prefer to perform a filter on =
> column "islem_tarihi" ... Why ?

Probably thinks that the extra index doesn't add enough selectivity to
be worth scanning.  It's probably right, too --- maybe with a narrower
date range the answer would be different.

I think the main problem in this plan is the poor estimation of the size
of the d1/s join.  Are your stats up to date on those tables?  Maybe
boosting the statistics target for one or both would help.

			regards, tom lane



view thread (3+ messages)  latest in thread

Message-ID: <29367.1140110856@sss.pgh.pa.us>
Permalink:  ../29367.1140110856@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/29367.1140110856@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, a_dursun@hotmail.com
  Subject: Re: Why does not perform index combination
  In-Reply-To: <29367.1140110856@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