Dear Josh,
The reason why I do things is two steps is that this allows me archive the
deleted items.
Llew
""Josh Berkus"" <josh@agliodbs.com> wrote in message
news:web-819049@davinci.ethosmedia.com...
> Llew,
>
> Do it all in one query:
>
> > DELETE FROM a
> > WHERE NOT EXISTS
> > (
> > SELECT b.join1
> > FROM b
> > WHERE
> > a.join1 = b.join1 AND
> > a.join2 = b.join2
> > )
>
> And make sure that join1 and join2 are indexed in both tables.
>
> -Josh Berkus
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://archives.postgresql.org