Received: from mail.astrofoto.org (dsl092-102-177.nyc2.dsl.speakeasy.net [66.92.102.177]) by postgresql.org (8.11.3/8.11.4) with ESMTP id fAFGQcm20177 for ; Thu, 15 Nov 2001 11:26:38 -0500 (EST) (envelope-from roland@astrofoto.org) Received: (from roland@localhost) by mail.astrofoto.org (8.11.6/8.11.6) id fAFGQfT15268; Thu, 15 Nov 2001 11:26:41 -0500 To: "Ilker Egilmez" Cc: pgsql-sql@postgresql.org Subject: Re: problem: index on number not honoured References: <9spaa8$inv$1@news.tht.net> From: Roland Roberts Date: 15 Nov 2001 11:26:41 -0500 In-Reply-To: <9spaa8$inv$1@news.tht.net> Message-ID: Lines: 27 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.0.105 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Archive-Number: 200111/217 X-Sequence-Number: 5600 >>>>> "Ilker" == Ilker Egilmez 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