Re: problem: index on number not honoured - Mailing list pgsql-sql

From Roland Roberts
Subject Re: problem: index on number not honoured
Date
Msg-id m2k7wsgfum.fsf@tycho.rlent.pnet
Whole thread Raw
In response to problem: index on number not honoured  ("Ilker Egilmez" <ilker@gate5.de>)
List pgsql-sql
>>>>> "Ilker" == Ilker Egilmez <ilker@gate5.de> writes:

   Ilker> an index on a table column of any number type only gets honoured if you   Ilker> query it like a string,
e.g.
   Ilker> create table t1 ( n int2 ) ;
   Ilker> create index t1n on t1 (n) ;
   Ilker> explain select * from t1 where n = 1 ;
   Ilker> -- Seq Scan on t1  (cost=0.00..22.50 rows=10 width=2)
   Ilker> explain select * from t1 where n = '1'  ;
   Ilker> -- Index Scan using t1n on t1  (cost=0.00..8.14 rows=10 width=2)

Two questions: have you run vacuum analyze on the table?  have you
submitted a bug report?

roland
--            PGP Key ID: 66 BC 3B CD
Roland B. Roberts, PhD                             RL Enterprises
roland@rlenter.com                     76-15 113th Street, Apt 3B
roland@astrofoto.org                       Forest Hills, NY 11375


pgsql-sql by date:

Previous
From: Roland Roberts
Date:
Subject: Re: INSERT question
Next
From: Tom Lane
Date:
Subject: Re: Unable to use '-' in column names in PLPGSQL