Re: [HACKERS] Interesting behaviour !

Hannu Krosing <hannu@trust.ee>

From: Hannu Krosing <hannu@trust.ee>
To: Constantin Teodorescu <teo@flex.ro>
Cc: "pgsql-hackers@postgreSQL.org" <pgsql-hackers@postgreSQL.org>
Date: 1999-07-14T10:27:54Z
Lists: pgsql-hackers
Constantin Teodorescu wrote:
> 
> 
> create table "note" (id serial,perioada int2,schema int2,explicatie
> text,...);
> 
...
> 
> contabil=> explain select * from note where perioada=15;
> NOTICE:  QUERY PLAN:
> Seq Scan on note  (cost=1099.99 rows=1600 width=87)

You may try :

explain select * from note where perioada=15::int2;

i think that the default for 'untyped' numbers is int4 and 
this currently confuses the optimiser.

------------------
Hannu