Re: Weird performance difference

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Israel Brewster <israel(at)ravnalaska(dot)net>
Cc: Justin Pryzby <pryzby(at)telsasoft(dot)com>, pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Weird performance difference
Date: 2017-10-21 00:38:33
Message-ID: 13423.1508546313@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Israel Brewster <israel(at)ravnalaska(dot)net> writes:
>> Can you send "explain" (not explain analyze) for the production server?

> Not for the full query - it only just completed, after 70 minutes or so, and I wasn't running under EXPLAIN ANALYZE. Running with a shorter date range of only 7 days, as you suggest below: https://explain.depesz.com/s/r80j <https://explain.depesz.com/s/r80j>

First thing that jumps out from that is

> Foreign Scan on oag_schedules (cost=100.00..128.60 rows=620 width=108) (actual time=3.576..477.524 rows=79,853 loops=1)

Being off by a factor of 100 at the scan level is never a good start for a
join plan. Turn on use_remote_estimate (assuming these are postgres_fdw
tables). Also try explicitly ANALYZE'ing the foreign tables. I do not
believe auto-analyze will touch foreign tables ...

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message doganmeh 2017-10-21 03:15:27 Restoring tables with circular references dumped to separate files
Previous Message Israel Brewster 2017-10-20 23:52:44 Re: Weird performance difference