Re: Update Perrformance with nested loop vs. merge-join - Mailing list pgsql-general

From Tom Lane
Subject Re: Update Perrformance with nested loop vs. merge-join
Date
Msg-id 3468.1165446334@sss.pgh.pa.us
Whole thread Raw
In response to Update Perrformance with nested loop vs. merge-join  ("Nathan Boley" <nate.boley@gmail.com>)
List pgsql-general
"Nathan Boley" <nate.boley@gmail.com> writes:
> Merge Join  (cost=883182.60..1024622.03 rows=6873573 width=89)
>   Merge Cond: ("outer".pkeycolumn1 = "inner".pkey)
>   ->  Sort  (cost=93387.50..94711.01 rows=529404 width=18)
>         Sort Key: table2.pkey
>         ->  Seq Scan on table2 (cost=0.00..15037.04 rows=529404 width=18)
>   ->  Sort  (cost=789795.10..795605.39 rows=2324116 width=81)
>         Sort Key: table1.pkeycolumn1
>         ->  Seq Scan on table1  (cost=0.00..71900.16 rows=2324116 width=81)

> This seems like it *should* be the best query to me, but when I try and run
> it it takes forever.

What PG version is this, and what have you got work_mem (or sort_mem)
set to?  I'm betting the sorts are slow ...

            regards, tom lane

pgsql-general by date:

Previous
From: Casey Duncan
Date:
Subject: Re: Anything I can do to speed up this query?
Next
From: Jeff Davis
Date:
Subject: Re: Trying to Understand Table Inheritance