Re: why provide cross type arithmetic operators - Mailing list pgsql-bugs

From Gregory Stark
Subject Re: why provide cross type arithmetic operators
Date
Msg-id 87y7aijc9l.fsf@oxford.xeocode.com
Whole thread Raw
In response to why provide cross type arithmetic operators  ("ykhuang" <hyk@ruc.edu.cn>)
Responses Re: why provide cross type arithmetic operators
List pgsql-bugs
"ykhuang" <hyk@ruc.edu.cn> writes:

> there are many cross type arithmetic operators, like int2 + int4, int8 +
> int4, I think these can be deleted. Here are the reasons, after deleted,
> int2 + int4 will choose the operator int4 + int4, int8 + int4 choose int8 +
> int8, Is that ok? Thanks.

Then the system wouldn't be able to use indexes as flexibly. For example if
you have an index on an int2 column and perform a query with a restriction
like "int2col = 1" the system wouldn't find a matching =(int2,int4) operator
and would instead have to do a sequential scan casting the int2 column to an
int4 when checking each row.


--
  Gregory Stark
  EnterpriseDB          http://www.enterprisedb.com
  Get trained by Bruce Momjian - ask me about EnterpriseDB's PostgreSQL training!

pgsql-bugs by date:

Previous
From: Michael Akinde
Date:
Subject: Re: BUG #3881: lo_open leaks memory
Next
From: Michael Akinde
Date:
Subject: Re: BUG #3881: lo_open leaks memory