Re: Checking = with timestamp field is slow

From: Michael Glaesemann <grzm(at)myrealbox(dot)com>
To: Michael Glaesemann <grzm(at)myrealbox(dot)com>
Cc: Antony Paul <antonypaul24(at)gmail(dot)com>, pgsql-performance(at)postgresql(dot)org
Subject: Re: Checking = with timestamp field is slow
Date: 2004-11-05 08:32:49
Message-ID: 4704C044-2F05-11D9-BE4A-000A95C88220@myrealbox.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance


On Nov 5, 2004, at 5:14 PM, Michael Glaesemann wrote:

>
> On Nov 5, 2004, at 4:16 PM, Antony Paul wrote:
>> 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.
>
> I'm sure others out there have better ideas, but you might want to try
>
> where current_date = date '2004-11-05'

Ach! just re-read that. today is one of your columns! Try

where today::date = date '2004-11-05'

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Michael Fuhr 2004-11-05 08:34:01 Re: Checking = with timestamp field is slow
Previous Message Michael Glaesemann 2004-11-05 08:14:01 Re: Checking = with timestamp field is slow