Re: Partitioning: Planner makes no use of indexes on inherited

From: Richard Huxton <dev(at)archonet(dot)com>
To: Stephen Friedrich <stephen(dot)friedrich(at)fortis-it(dot)de>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Partitioning: Planner makes no use of indexes on inherited
Date: 2006-01-18 09:50:28
Message-ID: 43CE0F64.2090407@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Stephen Friedrich wrote:
> Richard Huxton wrote:
>> I don't suppose changing it to:
>> ORDER BY this_.cdr_id, this_.id
>> does anything for you?
>
> Nope. Same cost :-(

Maybe I'm barking up the wrong tree then.

Maybe the costs for the index just look wrong.

Hmm - looking at it, this seems the case. Directly querying the
partition it uses the index but estimates a cost of:
cost=0.00..23510.68 rows=575532 width=8907)
The seq-scan says it has a cost of:
cost=0.00..20737.15 rows=575532 width=8907

Could you issue "set enable_seqscan=off" and then show explain analyse
on the second query again?

--
Richard Huxton
Archonet Ltd

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Kai Hessing 2006-01-18 09:51:12 Re: [GENERAL] Problem with restoring database from 7.3.1 to 8.0.1
Previous Message Joost Kraaijeveld 2006-01-18 09:39:00 Re: PostgreSQL Top 10 Wishlist