pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ron Johnson <ron.l.johnson@cox.net>
To: PgSQL General ML <pgsql-general@postgresql.org>
To: PgSQL Performance ML <pgsql-performance@postgresql.org>
Subject: Re: [PERFORM] Seq scan of table?
Date: Fri, 05 Sep 2003 11:09:18 -0500
Message-ID: <1062778158.17023.205.camel@haggis> (raw)
In-Reply-To: <Pine.GSU.4.44.0309050739000.13345-100000@eskimo.com>
References: <Pine.GSU.4.44.0309050739000.13345-100000@eskimo.com>

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




view thread (11+ messages)  latest in thread

Message-ID: <1062778158.17023.205.camel@haggis>
Permalink:  ../1062778158.17023.205.camel@haggis/
Also on:    postgresql.org/message-id/1062778158.17023.205.camel@haggis

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-performance@postgresql.org
  Cc: ron.l.johnson@cox.net, pgsql-general@postgresql.org
  Subject: Re: [PERFORM] Seq scan of table?
  In-Reply-To: <1062778158.17023.205.camel@haggis>
  References: <Pine.GSU.4.44.0309050739000.13345-100000@eskimo.com> <1062778158.17023.205.camel@haggis>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox