Re: [PERFORM] Seq scan of table?

From: Ron Johnson <ron(dot)l(dot)johnson(at)cox(dot)net>
To: PgSQL General ML <pgsql-general(at)postgresql(dot)org>, PgSQL Performance ML <pgsql-performance(at)postgresql(dot)org>
Subject: Re: [PERFORM] Seq scan of table?
Date: 2003-09-05 16:09:18
Message-ID: 1062778158.17023.205.camel@haggis
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-performance

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(dot)l(dot)johnson(at)cox(dot)net
Jefferson, LA USA

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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message psql-mail 2003-09-05 16:43:40 Re: postmaster crashing
Previous Message Tom Lane 2003-09-05 15:34:50 Re: default EXECUTE privilege

Browse pgsql-performance by date

  From Date Subject
Next Message Richard Huxton 2003-09-05 16:39:32 Re: Performance problems on a fairly big table with two
Previous Message Vivek Khera 2003-09-05 15:41:53 Re: checkpoints too frequent