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

Поиск
Список
Период
Сортировка
От Rod Taylor
Тема Re: why Sequencial Scan when selecting on primary key of table?
Дата
Msg-id 1054403470.11968.34.camel@jester
обсуждение исходный текст
Ответ на Re: why Sequencial Scan when selecting on primary key of table?  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: why Sequencial Scan when selecting on primary key of table?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-performance
On Sat, 2003-05-31 at 13:13, Tom Lane wrote:
> "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.

Out of curiosity, why don't we confirm the unquoted value is an integer,
numeric, etc, then change it into type 'unknown'?  From that point
forward it would be treated like it's quoted counterpart.

Is this noticeably slower or am I missing something?

--
Rod Taylor <rbt@rbt.ca>

PGP Key: http://www.rbt.ca/rbtpub.asc

Вложения

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

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