Re: Hash Right join and seq scan

From: Justin Pryzby <pryzby(at)telsasoft(dot)com>
To: James Pang <jamespang886(at)gmail(dot)com>
Cc: Tomas Vondra <tomas(dot)vondra(at)enterprisedb(dot)com>, David Rowley <dgrowleyml(at)gmail(dot)com>, pgsql-performance(at)lists(dot)postgresql(dot)org
Subject: Re: Hash Right join and seq scan
Date: 2024-07-08 02:26:56
Message-ID: ZotOcEv9R2bigCqX@pryzbyj2023
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Is the query fast with some bind parameters but slow with others?

If so, it'd be better to show an explain with 'fast' and 'slow' bind
params, rather than the same bind params with enable_*=off.

Or is the change because autoanalyze runs on some table and changes the
statistics enough to change the plan ? Investigate by setting
log_autovacuum_min_duration=0 or by checking
pg_stat_all_tables.last_{auto,}{vacuum,analyze}.

Maybe your llid/hhid are correlated, and you should CREATE STATISTICS.

Or maybe the answer will be to increase the stats target.

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Andrei Lepikhov 2024-07-08 07:24:53 Re: Low performance between datacenters
Previous Message James Pang 2024-07-08 02:21:58 Re: Hash Right join and seq scan