pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Steinar H. Gunderson <sgunderson@bigfoot.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Materializing a sequential scan
Date: Thu, 20 Oct 2005 00:58:51 -0400
Message-ID: <4452.1129784331@sss.pgh.pa.us> (raw)
In-Reply-To: <20051019174544.GA32303@samfundet.no>
References: <20051019174544.GA32303@samfundet.no>

"Steinar H. Gunderson" <sgunderson@bigfoot.com> writes:
> BEGIN
> 	INSERT INTO kortsys2.mdb_gruppekobling_temp
> 	SELECT overgruppe_id,undergruppe_id FROM gruppekobling gk
> 		JOIN gruppe g1 ON gk.overgruppe_id=g1.gruppe_id
> 		JOIN gruppe g2 ON gk.overgruppe_id=g2.gruppe_id
> 		WHERE g1.aktiv AND g2.aktiv;
> 	LOOP

BTW, it sure looks like that second JOIN ought to be
		JOIN gruppe g2 ON gk.undergruppe_id=g2.gruppe_id

As-is, it's not doing anything for you ... certainly not enforcing
that the undergruppe_id be aktiv.

			regards, tom lane



view thread (13+ messages)  latest in thread

Message-ID: <4452.1129784331@sss.pgh.pa.us>
Permalink:  ../4452.1129784331@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/4452.1129784331@sss.pgh.pa.us

 · 

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-performance@postgresql.org
  Cc: tgl@sss.pgh.pa.us, sgunderson@bigfoot.com
  Subject: Re: Materializing a sequential scan
  In-Reply-To: <4452.1129784331@sss.pgh.pa.us>

* 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