Re: [HACKERS] Interesting behaviour ! - Mailing list pgsql-hackers

From Hannu Krosing
Subject Re: [HACKERS] Interesting behaviour !
Date
Msg-id 378C662A.B3FFD088@trust.ee
Whole thread Raw
In response to Interesting behaviour !  (Constantin Teodorescu <teo@flex.ro>)
List 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


pgsql-hackers by date:

Previous
From: Nuchanach Klinjun
Date:
Subject: upgrade problem
Next
From: Duane Currie
Date:
Subject: Re: [HACKERS] Counting bool flags in a complex query