From: Markus Schaber <schabios@logi-track.com>
To: Merlin Moncure <merlin.moncure@rcsonline.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: best way to fetch next/prev record based on index
Date: Tue, 27 Jul 2004 16:50:44 +0200
Message-ID: <20040727165044.0549286e@kingfisher.intern.logi-track.com> (raw)
In-Reply-To: <6EE64EF3AB31D5448D0007DD34EEB34101AEF8@Herge.rcsinc.local>
References: <6EE64EF3AB31D5448D0007DD34EEB34101AEF8@Herge.rcsinc.local>
Hi, Merlin,
On Tue, 27 Jul 2004 10:21:32 -0400
"Merlin Moncure" <merlin.moncure@rcsonline.com> wrote:
> The basic problem is the planner can't always match the query to the
> index. So, either the planner has to be helped/fixed or I have to
> explore another solution. This seems to happen most when the 'a'
> column has very poor selectivity. In this case, the planner will only
> examine the 'a' part of the key.
So it may help to add some more indices so you have an index for all permutations,
Create an index on (a,b,c), (a,c,b), (b,c,a), (b,a,c), (c,a,b) and (c,b,a).
So as long as one of the rows has enough selectivity, the planner should
be able to select the correct index. Maybe increasing the number of
random samples for the rows is useful.
HTH,
Markus
--
markus schaber | dipl. informatiker
logi-track ag | rennweg 14-16 | ch 8001 zürich
phone +41-43-888 62 52 | fax +41-43-888 62 53
mailto:schabios@logi-track.com | www.logi-track.com
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-performance@postgresql.org
Cc: schabios@logi-track.com, merlin.moncure@rcsonline.com
Subject: Re: best way to fetch next/prev record based on index
In-Reply-To: <20040727165044.0549286e@kingfisher.intern.logi-track.com>
References: <6EE64EF3AB31D5448D0007DD34EEB34101AEF8@Herge.rcsinc.local> <20040727165044.0549286e@kingfisher.intern.logi-track.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