From: Tomaz Borstnar <tomaz.borstnar@over.net>
To: pgsql-performance@postgresql.org
Subject: Re: any way to use indexscan to get last X values
Date: Sun, 15 Jun 2003 17:17:04 +0200
Message-ID: <5.2.1.1.0.20030615171224.01c32eb0@127.0.0.1> (raw)
In-Reply-To: <3EECD0A2.8545.2FA1D9@localhost>
References: <5.2.1.1.0.20030615161722.025c7630@127.0.0.1>
At 16:31 15.6.2003, Shridhar Daithankar wrote:
>Question. The field approved seems to have boolean values. If probability of
>having either of value is 50%, I doubt planner will use index anyway.
True. It has Y or N only so index on approved is useless. But using index
on ORDER BY part would help a lot since it knows to fetch last X ordered
values.
>Correct me if I am wrong.
Unfortunately you are very right.
I am not sure how to stuff modifystamp and thread into WHERE clause to make
it use indexes on thread and/or modifystamp. So far I believe this would be
the only way to use them, right?
Tomaz
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: tomaz.borstnar@over.net
Subject: Re: any way to use indexscan to get last X values
In-Reply-To: <5.2.1.1.0.20030615171224.01c32eb0@127.0.0.1>
References: <5.2.1.1.0.20030615161722.025c7630@127.0.0.1> <5.2.1.1.0.20030615171224.01c32eb0@127.0.0.1>
* 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