pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Najm Hashmi <najm@mondo-live.com>
To: pgsql-sql@postgresql.org <pgsql-sql@postgresql.org>
Subject: About Index
Date: Wed, 03 Jan 2001 16:05:17 -0500
Message-ID: <3A53940D.9F214C69@mondo-live.com> (raw)

Hi,
   I have created a table songs as follwoing:
CREATE TABLE  songs  (
     song_id  serial NOT NULL,
     title  character varying(50) NOT NULL,
    composer   varchar(50),
     performer  varchar(50),
     artist_id  int4 not null,
     file_size  int4,
     description  text,
     extrInfo  text,
     highmd5  text,
     lowmd5  text,
      PRIMARY KEY (song_id),
     constraint fk_songs_art foreign key( artist_id) references artist
);
I also created an other index on attribute title as:
create unique index title_idx on songs(title);

Then I vacuum analyzed  my data base.

On command line I type :
explain select title from songs where song_id between 1 and 15 order by
song_id;
NOTICE:  QUERY PLAN:

Sort  (cost=1.70..1.70 rows=14 width=16)
  ->  Seq Scan on songs  (cost=0.00..1.44 rows=14 width=16)

EXPLAIN

One thing I don't uderstand why query planer is using a seq scan on my
table.
Why it is not using indexing defined. Thank you all for all your help.

Regards.
Najm




Message-ID: <3A53940D.9F214C69@mondo-live.com>
Permalink:  ../3A53940D.9F214C69@mondo-live.com/
Also on:    postgresql.org/message-id/3A53940D.9F214C69@mondo-live.com

 · 

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: najm@mondo-live.com
  Subject: Re: About Index
  In-Reply-To: <3A53940D.9F214C69@mondo-live.com>
  References: <3A53940D.9F214C69@mondo-live.com>

* 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