From: Tom Lane <tgl@sss.pgh.pa.us>
To: Alvaro Herrera <alvherre@commandprompt.com>
Cc: Jann Röder <roederja@ethz.ch>
Cc: pgsql-performance <pgsql-performance@postgresql.org>
Subject: Re: Inefficient query plan
Date: Mon, 23 Aug 2010 11:20:55 -0400
Message-ID: <21464.1282576855@sss.pgh.pa.us> (raw)
In-Reply-To: <1282574235-sup-6539@alvh.no-ip.org>
References: <i4st4a$e8v$1@dough.gmane.org>
<1282574235-sup-6539@alvh.no-ip.org>
Alvaro Herrera <alvherre@commandprompt.com> writes:
> Hmm, I'm placing bets on the bpchar weirdness. I'd try getting rid of
> that and using plain varchar for all the columns.
That's certainly what's inhibiting it from considering an indexscan
on the larger table. I'm not as convinced as the OP that a nestloop
indexscan is really going to win compared to the hash plan, but if
the comparison value is varchar then an index on a bpchar column
is simply not useful --- at least not unless you stick an explicit
cast into the query, so that the comparison will have bpchar rather
than varchar semantics.
regards, tom lane
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, alvherre@commandprompt.com, roederja@ethz.ch
Subject: Re: Inefficient query plan
In-Reply-To: <21464.1282576855@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