Re: 7.3.2 indexes in PL/PgSQL

Поиск
Список
Период
Сортировка
Искать
От
Tom Lane
Тема
Re: 7.3.2 indexes in PL/PgSQL
Дата
Msg-id
29607.1051301760@sss.pgh.pa.us
Ответ на
7.3.2 indexes in PL/PgSQL (Evgeny Duzhakow)
Список
Дерево обсуждения
7.3.2 indexes in PL/PgSQL Evgeny Duzhakow <diabolo@philol.msu.ru>
Re: 7.3.2 indexes in PL/PgSQL Tom Lane <tgl@sss.pgh.pa.us>
Evgeny Duzhakow  writes:
> SELECT playerid FROM players WHERE nickname = 'qq' AND password = 'qqq';
> [ does an index scan ]
> but in procedure on PL/PgSQL this select realy do sequense scan:

I'd bet that you were sloppy about datatypes.  Postgres will
automatically interpret those quoted literals as being the same datatype
as what they were compared to, but there's no such free lunch when
you're dealing with declared variables in a plpgsql function.  If the
datatypes don't match you probably won't get an index scan.  Change the
types to match or add explicit coercions.

			regards, tom lane
В списке pgsql-bugs по дате отправления
От: Oliver Elphick
Дата:
От: Tom Lane
Дата:
Сообщение: Re: postgres sql 7.1.1
FAQ