pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Roland Roberts <roland@astrofoto.org>
To: Ilker Egilmez <ilker@gate5.de>
Cc: pgsql-sql@postgresql.org
Subject: Re: problem: index on number not honoured
Date: 15 Nov 2001 11:26:41 -0500
Message-ID: <m2k7wsgfum.fsf@tycho.rlent.pnet> (raw)
In-Reply-To: <9spaa8$inv$1@news.tht.net>
References: <9spaa8$inv$1@news.tht.net>

>>>>> "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



view thread (3+ messages)  latest in thread

Message-ID: <m2k7wsgfum.fsf@tycho.rlent.pnet>
Permalink:  ../m2k7wsgfum.fsf@tycho.rlent.pnet/
Also on:    postgresql.org/message-id/m2k7wsgfum.fsf@tycho.rlent.pnet

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: roland@astrofoto.org, ilker@gate5.de
  Subject: Re: problem: index on number not honoured
  In-Reply-To: <m2k7wsgfum.fsf@tycho.rlent.pnet>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox