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

From: "Christopher Kings-Lynne" <chriskl(at)familyhealth(dot)com(dot)au>
To: "Reiner Dassing" <dassing(at)wettzell(dot)ifag(dot)de>, <pgsql-sql(at)postgresql(dot)org>
Cc: <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [HACKERS] Index of a table is not used (in any case)
Date: 2001-10-23 04:08:14
Message-ID: ECEHIKNFIMMECLEBJFIGAEEOCCAA.chriskl@familyhealth.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-sql

> Hello PostgreSQl Users!
>
> PostSQL V 7.1.1:

You should upgrade to 7.1.3 at some point...

> I have defined a table and the necessary indices.
> But the index is not used in every SELECT. (Therefore, the selects are
> *very* slow, due to seq scan on
> 20 million entries, which is a test setup up to now)
>
> The definitions can be seen in the annex.
>
> Does some body know the reason and how to circumvent the seq scan?

Yes. You probably have not run 'VACUUM ANALYZE' on your large table.

> Is the order of index creation relevant? I.e., should I create the
> indices before inserting
> entries or the other way around?

If you are inserting a great many entries, insert the data first and then
create the indices - it will be much faster this way.

> Should a hashing index be used? (I tried this, but I got the known error
> "Out of overflow pages")

Just do the default CREATE INDEX - btree should be fine... (probably)

> The table entry 'epoche' is used in two different indices. Should that
> be avoided?

It's not a problem, but just check your EXPLAIN output after the VACUUM to
check that you have them right.

Chris

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2001-10-23 04:11:07 Re: [GENERAL] To Postgres Devs : Wouldn't changing the selectlimit
Previous Message Doug McNaught 2001-10-23 04:00:24 Re: [HACKERS] Index of a table is not used (in any case)

Browse pgsql-sql by date

  From Date Subject
Next Message Stephan Szabo 2001-10-23 04:27:07 Re: Index of a table is not used (in any case)
Previous Message Doug McNaught 2001-10-23 04:00:24 Re: [HACKERS] Index of a table is not used (in any case)