Re: Inefficient query plan

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Alvaro Herrera <alvherre@xxxxxxxxxxxxxxxxx> 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

-- 
Sent via pgsql-performance mailing list (pgsql-performance@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance


[Postgresql General]     [Postgresql PHP]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Yosemite]

  Powered by Linux