From: Tom Lane <tgl@sss.pgh.pa.us>
To: Michael Monnerie <michael.monnerie@is.it-management.at>
Cc: pgsql-admin@postgresql.org
Subject: Re: Why is that index not used?
Date: Wed, 21 Jan 2009 10:51:40 -0500
Message-ID: <2612.1232553100@sss.pgh.pa.us> (raw)
In-Reply-To: <200901211634.42228@zmi.at>
References: <200901211634.42228@zmi.at>
Michael Monnerie <michael.monnerie@is.it-management.at> writes:
> Can somebody explain me why on the last line, "dbmail_physmessage",
> there is a seq. scan going on and no index used?
Because it chose to use a hash instead. Given the rowcounts I don't
think that's wrong, but if you want to see the other plan you can try
setting enable_hashjoin = off (and maybe enable mergejoin = off if
it goes to a merge join next).
As for your other question, the reason it likes the dbmail_messages_1
index is probably that it's a lot smaller than dbmail_messages_7.
The only thing I'm seeing that seems curious is that when forced to
use dbmail_messages_7, it isn't using what seems to be an available
index condition.
regards, tom lane
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-admin@postgresql.org
Cc: tgl@sss.pgh.pa.us, michael.monnerie@is.it-management.at
Subject: Re: Why is that index not used?
In-Reply-To: <2612.1232553100@sss.pgh.pa.us>
* 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