Re:

From: "Dan Langille" <dan(at)langille(dot)org>
To: Jean-Luc Lachance <jllachan(at)nsd(dot)ca>
Cc: Dan Langille <dan(at)langille(dot)org>, pgsql-sql(at)postgresql(dot)org
Subject: Re:
Date: 2003-09-29 21:19:04
Message-ID: 3F786988.30024.356FBB90@localhost
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On 29 Sep 2003 at 10:04, Jean-Luc Lachance wrote:

> Wouldn't:
>
> insert into r
> select count(*)
> from users
> where date( lastlogin) > current_date - MaxDays * interval '' 1 day''
> group by date( lastlogin);
>
> be more efficient?

Yes it would, by a factor of 5.

P.S. but it would not show dates for which there are no logins. The
above can return zero rows. The previous example always returns
MaxDays rows.
--
Dan Langille : http://www.langille.org/

In response to

  • Re: at 2003-09-29 14:04:08 from Jean-Luc Lachance

Browse pgsql-sql by date

  From Date Subject
Next Message David B 2003-09-29 21:30:39 How to figure out when was a table created
Previous Message Franco Bruno Borghesi 2003-09-29 20:17:30 Re: Help with pivoting tables