Re: why Sequencial Scan when selecting on primary key of table?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: why Sequencial Scan when selecting on primary key of table?
Дата
Msg-id 21073.1054401227@sss.pgh.pa.us
обсуждение исходный текст
Ответ на why Sequencial Scan when selecting on primary key of table?  ("Brian Tarbox" <btarbox@theworld.com>)
Ответы Re: why Sequencial Scan when selecting on primary key of table?
Re: why Sequencial Scan when selecting on primary key of table?
Список pgsql-performance
"Brian Tarbox" <btarbox@theworld.com> writes:
> When I say "explain select * from Patient where Patient_primary_key = 100"
> I get sequential scan.

Perhaps Patient_primary_key is not an integer field?  If not, you need
to cast the constant 100 to the right type.  Or write '100' with
single quotes around it, which leaves Postgres to choose the constant's
datatype.  (Yeah, I know, it's a pain in the neck.  We've had a lot of
discussions about how to fix this without breaking datatype extensibility;
no luck so far.)

            regards, tom lane

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

Предыдущее
От: Andrew Sullivan
Дата:
Сообщение: Re: why Sequencial Scan when selecting on primary key of table?
Следующее
От: "Brian Tarbox"
Дата:
Сообщение: Re: why Sequencial Scan when selecting on primary key of table?