From: Tino Wildenhain <tino@wildenhain.de>
To: dforum <dforums@vieonet.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: NOW vs CURRENT_DATE
Date: Mon, 25 Aug 2008 08:01:47 +0200
Message-ID: <48B24ACB.8010906@wildenhain.de> (raw)
In-Reply-To: <48B1BE33.3060505@vieonet.com>
References: <48B1BE33.3060505@vieonet.com>
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
Attachments:
smime.p7s (application/x-pkcs7-signature, 3.2K) download
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: tino@wildenhain.de, dforums@vieonet.com
Subject: Re: NOW vs CURRENT_DATE
In-Reply-To: <48B24ACB.8010906@wildenhain.de>
* 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