pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Martin Dolog <martin_dolog@tempest.sk>
To: pgsql-sql@postgresql.org
Subject: My Indices doesn't work
Date: Tue, 15 Aug 2000 10:34:56 +0200
Message-ID: <399900B0.6252E318@tempest.sk> (raw)

Hi *,

I have pgsql7.0.2 on Linux2.2.16 and table with following indices:

CREATE TABLE T1 (NUM INT NOT NULL, NAME VARCHAR(10) NOT NULL, POP
VARCHAR(10) NOT NULL);
CREATE INDEX T1_I_NUM ON T1(NUM);
CREATE INDEX T1_I_NAME ON T1(NAME);
CREATE INDEX T1_I_POP ON T1(POP);

... and some data, but I really don't understant how indices work, look
at that:

template1=# explain select * from t1 where num=2;
NOTICE:  QUERY PLAN:
Index Scan using t1_i_num on t1  (cost=0.00..8.14 rows=10 width=28)

what is ok, ***BUT***

template1=# explain select * from t1 where num>2;
NOTICE:  QUERY PLAN:
Seq Scan on t1  (cost=0.00..22.50 rows=333 width=28)


WHY SEQ SCAN ?!!?


thank you

-- 

#md



view thread (2+ messages)  latest in thread

Message-ID: <399900B0.6252E318@tempest.sk>
Permalink:  ../399900B0.6252E318@tempest.sk/
Also on:    postgresql.org/message-id/399900B0.6252E318@tempest.sk

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: martin_dolog@tempest.sk
  Subject: Re: My Indices doesn't work
  In-Reply-To: <399900B0.6252E318@tempest.sk>
  References: <399900B0.6252E318@tempest.sk>

* 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