Re: Inefficient query plan - Mailing list pgsql-performance

From Jann Röder
Subject Re: Inefficient query plan
Date
Msg-id i4ti0i$hec$1@dough.gmane.org
Whole thread Raw
In response to Re: Inefficient query plan  (Scott Marlowe <scott.marlowe@gmail.com>)
List pgsql-performance
Am 23.08.10 12:18, schrieb Scott Marlowe:
> On Mon, Aug 23, 2010 at 4:15 AM, Jann Röder <roederja@ethz.ch> wrote:
>> Am 23.08.10 07:52, schrieb Scott Marlowe:
>>> Also are a.indexid and b.indexid the same type?
>>>
>>
>> You mean ItemID? Fields of the same name are of the same type - so yes.
>> According to the documentation pgsql adds indexes for primary keys
>> automatically so (b.itemID, b.indexNumber) is indexed. Or do you think
>> adding an extra idnex for b.itemID alone will help? If I understand the
>> documentation correctly, pqSQL can use the first column of a
>> multi-column index as if it was indexed individually... but maybe I'm
>> wrong here.
>
> It can but that doesn't mean it will.  A multi-column index is often
> quite a bit bigger than a single column one.
>
> What happens if you try
>
> set enable_seqscan=off;
> (your query here)
>
Tried that already. The query plan is exactly the same.

pgsql-performance by date:

Previous
From: Scott Marlowe
Date:
Subject: Re: Inefficient query plan
Next
From: "Kevin Grittner"
Date:
Subject: Re: Inefficient query plan