From: Christian Kindler <christian.kindler@gmx.net>
To: Andrew Kroeger <andrew@sprocks.gotdns.com>
To: ksimpson@mailchannels.com
Cc: pgsql-sql@postgresql.org
Subject: Re: Comparing two slices within one table efficiently
Date: Mon, 13 Aug 2007 21:34:27 +0200
Message-ID: <20070813193427.76840@gmx.net> (raw)
In-Reply-To: <46C0B01C.3020307@sprocks.gotdns.com>
References: <1694202581-1187027999-cardhu_decombobulator_blackberry.rim.net-401169594-@bxe119.bisx.prod.on.blackberry>
<46C0B01C.3020307@sprocks.gotdns.com>
Yes and you could make it even more speedy with the use table partitioning.
http://www.postgresql.org/docs/8.1/interactive/ddl-partitioning.html> select
> t1.domain_id as domain_id,
> t1.mta_id as mta_id,
> t1.run_id as run_id_1,
> t1.attribute1 as attribute1_1,
> t1.attribute2 as attribute2_1,
> t2.run_id as run_id_2,
> t2.attribute1 as attribute1_2,
> t2.attribute2 as attribute2_2
> from
> t t1
> join t t2 on
> t1.mta_id = t2.mta_id and
> t1.domain_id = t2.domain_id and
> (t1.attribute1 != t2.attribute1 or t1.attribute2 != t2.attribute2)
--
cu
Chris
Ist Ihr Browser Vista-kompatibel? Jetzt die neuesten
Browser-Versionen downloaden: http://www.gmx.net/de/go/browser
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: christian.kindler@gmx.net, andrew@sprocks.gotdns.com, ksimpson@mailchannels.com
Subject: Re: Comparing two slices within one table efficiently
In-Reply-To: <20070813193427.76840@gmx.net>
* 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