From: Ben <bench@silentmedia.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-performance@postgresql.org
Subject: Re: IN not handled very well?
Date: Sun, 24 Sep 2006 11:12:25 -0700
Message-ID: <043C3275-F9CF-4B9B-AF9F-C9D0B35493BC@silentmedia.com> (raw)
In-Reply-To: <8361.1159120674@sss.pgh.pa.us>
References: <37536ADC-0D18-485C-9F77-B875D69FBCAA@silentmedia.com>
<8361.1159120674@sss.pgh.pa.us>
Ah, so I do. Thanks, that helps an awful lot.
But the plan is still twice as expensive as when I put in the static
values. Is it just unreasonable to expect the planner to see that
there aren't many rows in the subselect, so to use the bitmap scans
after all?
On Sep 24, 2006, at 10:57 AM, Tom Lane wrote:
> Ben <bench@silentmedia.com> writes:
>> -> Hash IN Join (cost=51.67..31794.72
>> rows=218 width=4)
>> Hash Cond: (("outer".puid)::text =
>> "inner".name)
>> -> Seq Scan on puid
>> (cost=0.00..23495.21 rows=1099421 width=44)
>
>> -> Bitmap Heap Scan on puid
>> (cost=20.03..59.52 rows=10 width=4)
>> Recheck Cond: ((puid =
>> 'f68dcf86-992c-2e4a-21fb-2fc8c56edfeb'::bpchar) OR (puid =
>> '7716dbcf-56ab-623b-ab33-3b2e67a0727c'::bpchar) OR (puid =
>
>
> Apparently you've got a datatype mismatch: name is text while puid is
> char(N). The comparisons to name can't be converted into indexscans
> on puid because the semantics aren't the same for text and char
> comparisons.
>
> 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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-performance@postgresql.org
Cc: bench@silentmedia.com, tgl@sss.pgh.pa.us
Subject: Re: IN not handled very well?
In-Reply-To: <043C3275-F9CF-4B9B-AF9F-C9D0B35493BC@silentmedia.com>
References: <37536ADC-0D18-485C-9F77-B875D69FBCAA@silentmedia.com> <8361.1159120674@sss.pgh.pa.us> <043C3275-F9CF-4B9B-AF9F-C9D0B35493BC@silentmedia.com>
* 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