Re: why Sequencial Scan when selecting on primary key of table? - Mailing list pgsql-performance

From Rod Taylor
Subject Re: why Sequencial Scan when selecting on primary key of table?
Date
Msg-id 1054403470.11968.34.camel@jester
Whole thread Raw
In response to Re: why Sequencial Scan when selecting on primary key of table?  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: why Sequencial Scan when selecting on primary key of table?  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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

Attachment

pgsql-performance by date:

Previous
From: "Brian Tarbox"
Date:
Subject: Re: why Sequencial Scan when selecting on primary key of table?
Next
From: Tom Lane
Date:
Subject: Re: why Sequencial Scan when selecting on primary key of table?