Re: Problem with nested query - Mailing list pgsql-general

From Tom Lane
Subject Re: Problem with nested query
Date
Msg-id 16810.970549016@sss.pgh.pa.us
Whole thread Raw
In response to Problem with nested query  (Denis Perchine <dyp@perchine.com>)
Responses Re: Problem with nested query  (Denis Perchine <dyp@perchine.com>)
List pgsql-general
Denis Perchine <dyp@perchine.com> writes:
> As far as you can see it uses sequence scan for inner select. This is quite
> strange as if I do this select with a constant it will use index scan:

Are the two tables' "email" fields declared as exactly the same
datatype?

IIRC, 7.0.* has a problem with recognizing that a type-coerced parameter
to an inner query is useful as an indexscan reference constant.  This is
fixed in current sources, but in the meantime avoiding an implicit type
coercion is the easiest workaround.

            regards, tom lane

pgsql-general by date:

Previous
From: Denis Perchine
Date:
Subject: Problem with nested query
Next
From: Tom Lane
Date:
Subject: Re: Fake table name?