From: Josh Berkus <josh@agliodbs.com>
To: Stephane DEWITTE <stephane@smeso.fr>
To: pgsql-sql@postgresql.org
Subject: Re: Help on indexes
Date: Wed, 15 May 2002 08:19:46 -0700
Message-ID: <web-1460613@davinci.ethosmedia.com> (raw)
In-Reply-To: <NOEAIPGJHJIHECKNEIBGIECHCPAA.stephane@smeso.fr>
Stephane,
> I don't understanf why it makes a seq scan on table mldecs on cases 2
> and 3,
> according that mldecs(ldec_dec_cod) has an index (named
> ldec_dec_cod_mldecs_key). The base is vacuumed and analyzed every
> night. How
> can I use the ldec_dec_cod_mldecs_key index on mldecs ?
First question: Have you actually measured the execution time of the
various queries? There are many cases where a Seq Scan is faster than
an Index Scan. For example, if in Case2, 50% of the entries were
values 'X' of 'Y', then a Seq Scan is the better approach.
Please determine that you actually have a problem with slow execution.
Otherwise, the query parser is just doing its job.
-Josh Berkus
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 using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: josh@agliodbs.com, stephane@smeso.fr
Subject: Re: Help on indexes
In-Reply-To: <web-1460613@davinci.ethosmedia.com>
* 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