Re: Hash Right join and seq scan

From: James Pang <jamespang886(at)gmail(dot)com>
To: Tomas Vondra <tomas(dot)vondra(at)enterprisedb(dot)com>
Cc: pgsql-performance(at)lists(dot)postgresql(dot)org
Subject: Re: Hash Right join and seq scan
Date: 2024-07-05 00:50:18
Message-ID: CAHgTRfdpuB36gPAR+oU2-191V92ML-usZZLH7KhRGdanF=simw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

we have a daily vacuumdb and analyze job, generally speaking it's done
in seconds, sometimes it suddenly running more than tens of minutes with
same bind variable values and huge temp space got used and at that time,
explain show "Hash Anti join, Hash Right join" with seq scan two tables.

Tomas Vondra <tomas(dot)vondra(at)enterprisedb(dot)com> 於 2024年7月4日週四 上午1:40寫道:

> Hi James,
>
> I think it'd be much easier to help you with investigating this issue if
> you shared the actual queries, and the full EXPLAIN ANALYZE output both
> with and without disabled hashjoin. Or even better, share a script that
> reproduces the issue (creates tables, loads data, runs the queries).
>
> BTW you suggested each partition has ~250k rows, but the explain plan
> snippet you shared does not seem to be consistent with that - it only
> shows 2500-5000 rows per partition. If you run ANALYZE on the table,
> does that change the plan?
>
> regards
>
> --
> Tomas Vondra
> EnterpriseDB: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>

Attachment Content-Type Size
sql_details.txt text/plain 67.2 KB

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Andrei Lepikhov 2024-07-05 02:04:31 Re: How to solve my slow disk i/o throughput during index scan
Previous Message FREYBURGER Simon (SNCF VOYAGEURS / DIRECTION GENERALE TGV / DM RMP YIELD MANAGEMENT) 2024-07-04 15:23:23 RE: How to solve my slow disk i/o throughput during index scan