pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Vortex <vortex25@gmx.de>
To: Bruno Wolff III <bruno@wolff.to>
Cc: pgsql-sql@postgresql.org
Subject: Re: select within aggregate?
Date: Sat, 7 May 2005 18:12:30 +0200
Message-ID: <20050507181230.4044d498.vortex25@gmx.de> (raw)
In-Reply-To: <20050506124923.GB14417@wolff.to>
References: <20050506092535.060bca35.vortex25@gmx.de>
	<20050506124923.GB14417@wolff.to>

On Fri, 6 May 2005 07:49:23 -0500
Bruno Wolff III <bruno@wolff.to> wrote:

> You could use max(ts) as long as you can have two requests occur at the
> same time. This might be a reasonable assumption, but it might have been
> better to include a sequence so that each record would be guaranteed to
> have a unique key.
Yes, of course. So far it was more a theoretical question.

> Using DISTINCT ON to get the latest URIs is probably better. You can
> join that query to the one doing the count. This will probably be more
> efficient than executing a subquery for each remote host.
The DISTINCT ON construction looks quite interesting. It seems to allow
some sorting within an group (even althought it's no real aggregate) in
general. I can't say if it's really more eficient than the solution suggested
by R.Muralidharan. But i will do some tests!

Thank you very much!

Klaus



view thread (5+ messages)

Message-ID: <20050507181230.4044d498.vortex25@gmx.de>
Permalink:  ../20050507181230.4044d498.vortex25@gmx.de/
Also on:    postgresql.org/message-id/20050507181230.4044d498.vortex25@gmx.de

 · 

reply

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-sql@postgresql.org
  Cc: vortex25@gmx.de, bruno@wolff.to
  Subject: Re: select within aggregate?
  In-Reply-To: <20050507181230.4044d498.vortex25@gmx.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