Re: Index of a table is not used (in any case) - Mailing list pgsql-sql

From Doug McNaught
Subject Re: Index of a table is not used (in any case)
Date
Msg-id m3y9m2h5mg.fsf@belphigor.mcnaught.org
Whole thread Raw
In response to Index of a table is not used (in any case)  (Reiner Dassing <dassing@wettzell.ifag.de>)
List pgsql-sql
Reiner Dassing <dassing@wettzell.ifag.de> writes:

> I would like to mention first, that I will use the [SQL] list for my
> answers,
> regarding the notice of Josh Berkus.
> 
> Q: "did you use VACUUM ANALYZE"?
> A: This table was a test bed, just using INSERTS without ANY deletes or
> updates

You still need to run VACUUM ANALYZE.  The ANALYZE part measures the
statistics of your data, which the planner needs in order to make
decision. 


> Am afraid, that the real answer is not mentioned:
> Why is the index used in the SELECT:
> select * from wetter order by epoche desc;
>  
> 
> select * from wetter where epoche between '1970-01-01' and '1980-01-01'
> order by epoche asc;

If you EXPLAIN output for these queries, someone can probably help
you. 

-Doug
-- 
Let us cross over the river, and rest under the shade of the trees.  --T. J. Jackson, 1863


pgsql-sql by date:

Previous
From: "Stefan Lindner"
Date:
Subject: Re: system maintained keys
Next
From: "Pat M"
Date:
Subject: Re: Deleting obsolete values