Re: [PERFORM] Seq scan of table? - Mailing list pgsql-general

From Ron Johnson
Subject Re: [PERFORM] Seq scan of table?
Date
Msg-id 1062778158.17023.205.camel@haggis
Whole thread Raw
In response to Re: Seq scan of table?  (Jonathan Bartlett <johnnyb@eskimo.com>)
List pgsql-general
On Fri, 2003-09-05 at 09:39, Jonathan Bartlett wrote:
> > I think I have found out why.. I have a where clause on a ID field but it
> > seems like I need to cast this integer to the same integer as the field is
> > defined in the table, else it will do a tablescan.
>
> Yes, this is correct
>
> > Is this assumtion correct? And if it is, do I then need to change all my
> > sql's to cast the where clause where I just have a number (eg where field
> > = 1) to force the planner to use index scan instead of seq scan?
>
> Someone correct me if I'm wrong, but I believe numbers are int4's, so they
> need to be cast if your column is not an int4.

You mean "constant" scalars?  Yes, constants scalars are interpreted
as int4.

--
-----------------------------------------------------------------
Ron Johnson, Jr. ron.l.johnson@cox.net
Jefferson, LA USA

"Millions of Chinese speak Chinese, and it's not hereditary..."
Dr. Dean Edell


pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: default EXECUTE privilege
Next
From: psql-mail@freeuk.com
Date:
Subject: Re: postmaster crashing