Re: Query Plan choice with timestamps

From: Richard Huxton <dev(at)archonet(dot)com>
To: Giorgio Valoti <giorgio_v(at)mac(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Query Plan choice with timestamps
Date: 2008-08-07 08:35:55
Message-ID: 489AB3EB.8040903@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

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

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Henrik 2008-08-07 08:46:28 Filesystem setup on new system
Previous Message Richard Huxton 2008-08-07 08:33:57 Re: Plz Heeeelp! performance settings