Re: Materializing a sequential scan - Mailing list pgsql-performance

From Tom Lane
Subject Re: Materializing a sequential scan
Date
Msg-id 4452.1129784331@sss.pgh.pa.us
Whole thread Raw
In response to Materializing a sequential scan  ("Steinar H. Gunderson" <sgunderson@bigfoot.com>)
Responses Re: Materializing a sequential scan  ("Steinar H. Gunderson" <sgunderson@bigfoot.com>)
List pgsql-performance
"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

pgsql-performance by date:

Previous
From: Tom Lane
Date:
Subject: Re: Materializing a sequential scan
Next
From: Nörder-Tuitje, Marcus
Date:
Subject: Re: Inefficient escape codes.