pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Neil Conway <neilc@samurai.com>
To: Shridhar Daithankar <shridhar_daithankar@persistent.co.in>
Cc: Ivar Zarans <iff@alcaron.ee>
Cc: pgsql-performance@postgresql.org
Subject: Re: Slow UPADTE, compared to INSERT
Date: Sat, 06 Dec 2003 14:54:03 -0500
Message-ID: <871xrh90ys.fsf@mailbox.samurai.com> (raw)
In-Reply-To: <3FD08D6A.4080207@persistent.co.in>
References: <20031204185751.GA15893@alcaron.ee>
	<20031205014514.GA21079@alcaron.ee>
	<20031205020728.GA21440@alcaron.ee>
	<200312051008.20317.dev@archonet.com>
	<20031205123843.GA27170@alcaron.ee>
	<3FD07EEA.8030007@persistent.co.in>
	<20031205131325.GB27524@alcaron.ee>
	<3FD08D6A.4080207@persistent.co.in>

Shridhar Daithankar <shridhar_daithankar@persistent.co.in> writes:
> This is not a bug. It is just that people find it confusing when
> postgresql planner consider seemingly same type as different.

It certainly is a bug, or at least a deficiency: PostgreSQL planner
*could* use the index to process the query, but the planner doesn't
consider doing so. The fact that it isn't able to do the necessary
type coercion is the *cause* of the bug, not a defence for this
behavior.

> AFAIK, the fix in CVS is to make indexes operatable with seemingly
> compatible types. Which does not change the fact that postgresql can
> not upgrade data types on it's own.

I'm not sure what you mean by that. In any case, I just checked, and
it does seem Tom has fixed this in CVS:

template1=# create table abc (b int8);
CREATE TABLE
template1=# set enable_seqscan = false;
SET
template1=# create index abc_b_idx on abc (b);
CREATE INDEX
template1=# explain select * from abc where b = 4;
                              QUERY PLAN                              
----------------------------------------------------------------------
 Index Scan using abc_b_idx on abc  (cost=0.00..17.07 rows=5 width=8)
   Index Cond: (b = 4)
(2 rows)

Cool!

-Neil




view thread (24+ messages)

Message-ID: <871xrh90ys.fsf@mailbox.samurai.com>
Permalink:  ../871xrh90ys.fsf@mailbox.samurai.com/
Also on:    postgresql.org/message-id/871xrh90ys.fsf@mailbox.samurai.com

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: neilc@samurai.com, shridhar_daithankar@persistent.co.in, iff@alcaron.ee
  Subject: Re: Slow UPADTE, compared to INSERT
  In-Reply-To: <871xrh90ys.fsf@mailbox.samurai.com>

* 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