Re: NOW vs CURRENT_DATE

From: Tino Wildenhain <tino(at)wildenhain(dot)de>
To: dforum <dforums(at)vieonet(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: NOW vs CURRENT_DATE
Date: 2008-08-25 06:01:47
Message-ID: 48B24ACB.8010906@wildenhain.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Hi,

dforum wrote:
> Hello every body,
>
> I just discover a big not only big huge difference between NOW() and
> CURRENT_DATE.
>
> Did you already know about it and do you know why ?
>
> DELETE FROM blacklist where bl_date < (NOW() - interval '2 DAY');
> on 6 000 000 of records
> 699 ms
>
> DELETE FROM blacklist where bl_date < (CURRENT_DATE - interval '2 DAY');
> on 6 000 000 of records

Try that with a timestamp - column and use now() and current_timestamp
with a long running query and then compare min(column) max(column) in
both cases :-)

Regards
Tino

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Alexander Staubo 2008-08-25 08:18:24 Re: Identifying the nature of blocking I/O
Previous Message Alvaro Herrera 2008-08-25 02:16:09 Re: Identifying the nature of blocking I/O