pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jann Röder <roederja@ethz.ch>
To: pgsql-performance@postgresql.org
Subject: Re: Inefficient query plan
Date: Mon, 23 Aug 2010 12:20:02 +0200
Message-ID: <i4ti0i$hec$1@dough.gmane.org> (raw)
In-Reply-To: <AANLkTi=9kbbKV0E0Jao6e7jBAZ1SB=QWKVxzotC_ZQ9R@mail.gmail.com>
References: <i4st4a$e8v$1@dough.gmane.org>
	<AANLkTi=uFQ7saSbPUgK0hO2=e1MVQGenuLKOUU_+bvUM@mail.gmail.com>
	<i4thof$gol$1@dough.gmane.org>
	<AANLkTi=9kbbKV0E0Jao6e7jBAZ1SB=QWKVxzotC_ZQ9R@mail.gmail.com>

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.




view thread (23+ messages)  latest in thread

Message-ID: <i4ti0i$hec$1@dough.gmane.org>
Permalink:  ../i4ti0i$hec$1@dough.gmane.org/
Also on:    postgresql.org/message-id/i4ti0i$hec$1@dough.gmane.org

 · 

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: roederja@ethz.ch
  Subject: Re: Inefficient query plan
  In-Reply-To: <i4ti0i$hec$1@dough.gmane.org>

* 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