Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sQe5m-00Aubn-GV for pgsql-performance@arkaria.postgresql.org; Mon, 08 Jul 2024 02:27:02 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1sQe5k-00022p-V5 for pgsql-performance@arkaria.postgresql.org; Mon, 08 Jul 2024 02:27:00 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sQe5k-00022a-Ku for pgsql-performance@lists.postgresql.org; Mon, 08 Jul 2024 02:27:00 +0000 Received: from charmander.telsasoft.com ([50.244.222.1] helo=pryzbyj2023.telsasoft) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sQe5i-000wRw-4p for pgsql-performance@lists.postgresql.org; Mon, 08 Jul 2024 02:26:59 +0000 Received: by pryzbyj2023.telsasoft (Postfix, from userid 1000) id 988283526; Sun, 7 Jul 2024 21:26:56 -0500 (CDT) Date: Sun, 7 Jul 2024 21:26:56 -0500 From: Justin Pryzby To: James Pang Cc: Tomas Vondra , David Rowley , pgsql-performance@lists.postgresql.org Subject: Re: Hash Right join and seq scan Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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.