pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Justin Pryzby <pryzby@telsasoft.com>
To: James Pang <jamespang886@gmail.com>
Cc: Tomas Vondra <tomas.vondra@enterprisedb.com>
Cc: David Rowley <dgrowleyml@gmail.com>
Cc: pgsql-performance@lists.postgresql.org
Subject: Re: Hash Right join and seq scan
Date: Sun, 7 Jul 2024 21:26:56 -0500
Message-ID: <ZotOcEv9R2bigCqX@pryzbyj2023> (raw)
In-Reply-To: <CAHgTRfdpuB36gPAR+oU2-191V92ML-usZZLH7KhRGdanF=simw@mail.gmail.com>
References: <CAHgTRffB3SYu2oYYZSWCcF7Vf0AUU_QH-EDA8GeUCbJ5yyZZ-g@mail.gmail.com>
	<CAHgTRffpgT-qB1Cb=VW8z1ucS6ksGLtMrveqS2PFwiY=uEATyw@mail.gmail.com>
	<CAHgTRfeW+Oaj2SQDxZ3ie4EfeFAjoo9MSc3huqD5A43XAG90Tg@mail.gmail.com>
	<a757dc17-2339-446c-b59c-bd0d1efb3aca@enterprisedb.com>
	<CAHgTRfdpuB36gPAR+oU2-191V92ML-usZZLH7KhRGdanF=simw@mail.gmail.com>

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.





view thread (10+ messages)

Message-ID: <ZotOcEv9R2bigCqX@pryzbyj2023>
Permalink:  ../ZotOcEv9R2bigCqX@pryzbyj2023/
Also on:    postgresql.org/message-id/ZotOcEv9R2bigCqX@pryzbyj2023

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: pryzby@telsasoft.com, jamespang886@gmail.com, tomas.vondra@enterprisedb.com, dgrowleyml@gmail.com, pgsql-performance@lists.postgresql.org
  Subject: Re: Hash Right join and seq scan
  In-Reply-To: <ZotOcEv9R2bigCqX@pryzbyj2023>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox