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

Поиск
Список
Период
Сортировка
От Brian Tarbox
Тема Re: why Sequencial Scan when selecting on primary key of table?
Дата
Msg-id 000001c3279c$79dc2d80$01000001@trouble
обсуждение исходный текст
Ответ на 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?
Re: why Sequencial Scan when selecting on primary key of table?
Список pgsql-performance
The primary key field is an integer and I have performed vacuum analyse but
that does not seem to change anything.

I've also heard that postgres will not indexes when JOINing tables.  Can
that really be true??

Brian


-----Original Message-----
From: pgsql-performance-owner@postgresql.org
[mailto:pgsql-performance-owner@postgresql.org]On Behalf Of Tom Lane
Sent: Saturday, May 31, 2003 1:14 PM
To: Brian Tarbox
Cc: pgsql-performance@postgresql.org
Subject: Re: [PERFORM] why Sequencial Scan when selecting on primary key
of table?


"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

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org


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

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