Received: from lin.local.lan ([216.221.221.2]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id f02KxkO43070 for ; Tue, 2 Jan 2001 15:59:47 -0500 (EST) (envelope-from najm@mondo-live.com) Received: from mondo-live.com (IDENT:najm@ll20.local2.lan [192.168.2.20]) by lin.local.lan (8.9.3/8.8.7) with ESMTP id TAA29428 for ; Tue, 2 Jan 2001 19:14:37 GMT Message-ID: <3A53940D.9F214C69@mondo-live.com> Date: Wed, 03 Jan 2001 16:05:17 -0500 From: Najm Hashmi X-Mailer: Mozilla 4.76 [en] (X11; U; Linux 2.2.14-5.0 i686) X-Accept-Language: en MIME-Version: 1.0 To: "pgsql-sql@postgresql.org" Subject: About Index Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Archive-Number: 200101/17 X-Sequence-Number: 678 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