pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Rod Taylor <rbt@rbt.ca>
Cc: Brian Tarbox <btarbox@theworld.com>
Cc: Postgresql Performance <pgsql-performance@postgresql.org>
Subject: Re: why Sequencial Scan when selecting on primary key of table?
Date: Sat, 31 May 2003 14:12:30 -0400
Message-ID: <21406.1054404750@sss.pgh.pa.us> (raw)
In-Reply-To: <1054403470.11968.34.camel@jester>
References: <004301c32791$f983c710$01000001@trouble>
	<21073.1054401227@sss.pgh.pa.us>
	<1054403470.11968.34.camel@jester>

Rod Taylor <rbt@rbt.ca> writes:
> Out of curiosity, why don't we confirm the unquoted value is an integer,
> numeric, etc, then change it into type 'unknown'?

UNKNOWNNUMERIC is one of the ideas that's been proposed, but it's not
clear to me that it is better than other alternatives.  In particular,
I don't like losing knowledge of the form and size of the constant.
Something like "WHERE int4col = 4.8" should yield FALSE, not "ERROR:
pg_atoi: unable to parse '4.8'" which is what you're likely to get with
a naive "unknown numeric type" approach.  A perhaps-more-realistic
objection is that it only solves the problem for trivial "var = const"
cases.  As soon as you look at even slightly more complicated
expressions, it stops doing much good.

I'm still of the opinion that the best solution in the long run is to
get rid of most of the cross-datatype numeric operators, but there are
pitfalls there too.  See last thread on the issue:
http://archives.postgresql.org/pgsql-hackers/2002-11/msg00468.php

			regards, tom lane



view thread (8+ messages)

Message-ID: <21406.1054404750@sss.pgh.pa.us>
Permalink:  ../21406.1054404750@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/21406.1054404750@sss.pgh.pa.us

 · 

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: tgl@sss.pgh.pa.us, rbt@rbt.ca, btarbox@theworld.com
  Subject: Re: why Sequencial Scan when selecting on primary key of table?
  In-Reply-To: <21406.1054404750@sss.pgh.pa.us>
  References: <004301c32791$f983c710$01000001@trouble> <21073.1054401227@sss.pgh.pa.us> <1054403470.11968.34.camel@jester> <21406.1054404750@sss.pgh.pa.us>

* 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