From: Christopher Kings-Lynne <chriskl@familyhealth.com.au>
To: Reiner Dassing <dassing@wettzell.ifag.de>
To: pgsql-sql@postgresql.org
Cc: pgsql-hackers@postgresql.org
Subject: Re: [HACKERS] Index of a table is not used (in any case)
Date: Tue, 23 Oct 2001 12:08:14 +0800
Message-ID: <ECEHIKNFIMMECLEBJFIGAEEOCCAA.chriskl@familyhealth.com.au> (raw)
In-Reply-To: <3BD3BFE0.55FC3EC0@wettzell.ifag.de>
> 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-sql@postgresql.org
Cc: chriskl@familyhealth.com.au, dassing@wettzell.ifag.de, pgsql-hackers@postgresql.org
Subject: Re: [HACKERS] Index of a table is not used (in any case)
In-Reply-To: <ECEHIKNFIMMECLEBJFIGAEEOCCAA.chriskl@familyhealth.com.au>
References: <3BD3BFE0.55FC3EC0@wettzell.ifag.de> <ECEHIKNFIMMECLEBJFIGAEEOCCAA.chriskl@familyhealth.com.au>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox