Index not being used - Mailing list pgsql-general

From Ralph Smith
Subject Index not being used
Date
Msg-id 76FE42D1-7793-41CC-B756-1CA8034C08F8@u.washington.edu
Whole thread Raw
Responses Re: Index not being used
List pgsql-general
I'm confused.  Shouldn't this index be used?
(It's running on v7.4.7)

airburst=> \d stats2
             Table "public.stats2"
  Column   |         Type          | Modifiers
-----------+-----------------------+-----------
lab       | character varying(30) |
name      | character varying(50) |
status    | character varying(40) |
eventtime | integer               |
username  | character varying(30) |
pkey      | character varying(60) |
Indexes:
    "stats2_etime_index" btree (eventtime)

airburst=> \d stats2_etime_index
Index "public.stats2_etime_index"
  Column   |  Type  
-----------+---------
eventtime | integer
btree, for table "public.stats2"

airburst=> explain select count(*) from stats2 where eventtime > 1167638400 ;
                              QUERY PLAN                              
-----------------------------------------------------------------------
Aggregate  (cost=185247.97..185247.97 rows=1 width=0)
   ->  Seq Scan on stats2  (cost=0.00..179622.45 rows=2250205 width=0)
         Filter: (eventtime > 1167638400)
(3 rows)

Thanks,
Ralph

pgsql-general by date:

Previous
From: "Peter Childs"
Date:
Subject: Re: Reordering columns, will this ever be simple?
Next
From: "Scott Marlowe"
Date:
Subject: Re: Index not being used