Optimization FAQ ? - Mailing list pgsql-hackers

From Hiroshi Inoue
Subject Optimization FAQ ?
Date
Msg-id 000401bec41f$ce81dcc0$2801007e@cadzone.tpf.co.jp
Whole thread Raw
List pgsql-hackers
Hello all,

I got the following result.
It's FAQ ?

drop table int2t;
create table int2t (id int2 primary key);

explain select * from int2t where id=1; NOTICE:  QUERY PLAN:
 Seq Scan on int2t  (cost=43.00 rows=2 width=2) 

explain select * from int2t where id=1::int2; NOTICE:  QUERY PLAN:
 Index Scan using int2t_pkey on int2t  (cost=2.05 rows=2 width=2) 

explain select * from int2t where id='1'; NOTICE:  QUERY PLAN:
 Index Scan using int2t_pkey on int2t  (cost=2.05 rows=2 width=2) 

Right behavior ?

Regards.

Hiroshi Inoue
Inoue@tpf.co.jp


pgsql-hackers by date:

Previous
From: "Collin F. Lynch"
Date:
Subject: Time and microseconds?
Next
From: Dmitry Samersoff
Date:
Subject: MySQL comparison ...