Re: plpgsql and index usage

Поиск
Список
Период
Сортировка
От Ryan Mahoney
Тема Re: plpgsql and index usage
Дата
Msg-id mt680v00mlf17bn0kdogui0s8i6b5vbqln@4ax.com
обсуждение исходный текст
Ответ на Re: plpgsql and index usage  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: plpgsql and index usage  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
>Ryan Mahoney <ryan@flowlabs.com> writes:
>>  Index Scan using pa_zipcode_proximity_pk on pa_zipcode_proximity  (cost=
>> 0.00..13.53 rows=3 width=862)
>>    Index Cond: ((zipcode = '11103'::bpchar) AND (proximity <= 100))
>> (183 rows)
>
>Hmm ... evidently zipcode is declared as type char(5) (note the "bpchar"
>coercion).  Is the plpgsql variable it's being compared to declared the
>same way?  This could be ye olde cross-datatype-coercion problem.

Interesting!  I think in plpgsql the data type of the argument coming
in to the function is "text".  Are you suggesting that I:a. use a different datatype in plpgsql or b. cast the values
orc.change the data type in the table
 

I am not familiar with the bpchar type, but I am looking into it now.

Thanks!

-r


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Resource management in 7.4
Следующее
От: Hans-Jürgen Schönig
Дата:
Сообщение: Re: Resource management in 7.4