Re: query not using index - Mailing list pgsql-general

From Joe Conway
Subject Re: query not using index
Date
Msg-id 012201c13495$10d524a0$0705a8c0@jecw2k1
Whole thread Raw
In response to query not using index  ("Norbert Zoltan Toth" <Norbert.Zoltan.Toth@cern.ch>)
List pgsql-general
>     explain select event_id from history where event_type = 120;
>     NOTICE:  QUERY PLAN:
>
>     Seq Scan on history  (cost=0.00..446079.00 rows=200000 width=8)
>
> even if I do a drop index history_idx, explains sais the same.
>

Try
    explain select event_id from history where event_type = 120::int8;

See
    http://fts.postgresql.org/db/mw/msg.html?mid=1031765
for some further explanation/history.

HTH,
-- Joe



pgsql-general by date:

Previous
From: "Andrew Snow"
Date:
Subject: Re: Perl won't eval PgSQL boolean value
Next
From: Stephan Szabo
Date:
Subject: Re: Referential Integrity --> SystemTables