Re: Index of a table is not used (in any case)

From: Doug McNaught <doug(at)wireboard(dot)com>
To: Reiner Dassing <dassing(at)wettzell(dot)ifag(dot)de>
Cc: pgsql-sql(at)postgresql(dot)org, Josh(at)agliodbs(dot)com, sszabo(at)megazone23(dot)bigpanda(dot)com, chriskl(at)familyhealth(dot)com(dot)au
Subject: Re: Index of a table is not used (in any case)
Date: 2001-10-23 13:01:59
Message-ID: m3y9m2h5mg.fsf@belphigor.mcnaught.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-sql

Reiner Dassing <dassing(at)wettzell(dot)ifag(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Marc Spitzer 2001-10-23 13:28:47 Re: Index of a table is not used (in any case)
Previous Message Mark 2001-10-23 12:53:00 dynamic #include's?

Browse pgsql-sql by date

  From Date Subject
Next Message Marc Spitzer 2001-10-23 13:28:47 Re: Index of a table is not used (in any case)
Previous Message Haller Christoph 2001-10-23 10:15:53 Re: Query On Case structure