Skip site navigation (1) Skip section navigation (2)

Re: Inefficient query plan

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Cc: Jann Röder <roederja(at)ethz(dot)ch>, pgsql-performance <pgsql-performance(at)postgresql(dot)org>
Subject: Re: Inefficient query plan
Date: 2010-08-23 15:20:55
Message-ID: 21464.1282576855@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-performance
Alvaro Herrera <alvherre(at)commandprompt(dot)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

In response to

pgsql-performance by date

Next:From: gnuoytrDate: 2010-08-23 15:22:46
Subject: Re: Inefficient query plan
Previous:From: Kevin GrittnerDate: 2010-08-23 15:03:11
Subject: Re: Inefficient query plan

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group