From: Richard Huxton <dev@archonet.com>
To: Giorgio Valoti <giorgio_v@mac.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Query Plan choice with timestamps
Date: Thu, 07 Aug 2008 09:35:55 +0100
Message-ID: <489AB3EB.8040903@archonet.com> (raw)
In-Reply-To: <321506D5-4400-470C-909E-C7700D49A540@mac.com>
References: <321506D5-4400-470C-909E-C7700D49A540@mac.com>
Giorgio Valoti wrote:
> Hi, I have a timestamptz field that I want to use with a query, but I
> don’t need the full timestamp resolution, so I’ve created a
> day_trunc(timestamptz) immutable function which I’ll use with the query
> and with a new index:
>
> logs=> create index test_idx on blackbox (day_trunc(ts));
>
> However, the query plan doesn’t use the index:
Does it use it ever? e.g. with
SELECT * FROM blackbox WHERE day_trunk(ts) = '...'
--
Richard Huxton
Archonet Ltd
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: dev@archonet.com, giorgio_v@mac.com
Subject: Re: Query Plan choice with timestamps
In-Reply-To: <489AB3EB.8040903@archonet.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