From: Christopher Browne <cbbrowne@acm.org>
To: pgsql-performance@postgresql.org
Subject: Re: Checking = with timestamp field is slow
Date: Fri, 05 Nov 2004 07:47:54 -0500
Message-ID: <m3zn1wsbr9.fsf@knuth.knuth.cbbrowne.com> (raw)
References: <2989532e0411042316566b35f4@mail.gmail.com>
After a long battle with technology, antonypaul24@gmail.com (Antony Paul), an earthling, wrote:
> Hi all,
> I have a table which have more than 200000 records. I need to get
> the records which matches like this
>
> where today::date = '2004-11-05';
>
> This is the only condition in the query. There is a btree index on the
> column today.
> Is there any way to optimise it.
How about changing the criterion to:
where today between '2004-11-05' and '2004-11-06';
That ought to make use of the index on "today".
--
"cbbrowne","@","ntlug.org"
http://www.ntlug.org/~cbbrowne/sgml.html
"People need to quit pretending they can invent THE interface and walk
away from it, like some Deist fantasy." -- Michael Peck
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-performance@postgresql.org
Cc: cbbrowne@acm.org
Subject: Re: Checking = with timestamp field is slow
In-Reply-To: <m3zn1wsbr9.fsf@knuth.knuth.cbbrowne.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