Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nlrXN-00062d-B2 for pgsql-performance@arkaria.postgresql.org; Tue, 03 May 2022 12:21:53 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nlrXL-0008IB-J4 for pgsql-performance@arkaria.postgresql.org; Tue, 03 May 2022 12:21:51 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nlrXL-0008GI-6v for pgsql-performance@lists.postgresql.org; Tue, 03 May 2022 12:21:51 +0000 Received: from mx.zeyos.com ([88.99.153.70]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nlrXI-0000qf-V6 for pgsql-performance@postgresql.org; Tue, 03 May 2022 12:21:50 +0000 Received: from mx.zeyos.com (localhost [127.0.0.1]) by mx.zeyos.com (Postfix) with ESMTP id AF4966205B for ; Tue, 3 May 2022 14:21:46 +0200 (CEST) Authentication-Results: mx.zeyos.com (amavisd-new); dkim=pass (1024-bit key) reason="pass (just generated, assumed good)" header.d=zeyos.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=zeyos.com; h= content-transfer-encoding:content-type:content-type:mime-version :references:in-reply-to:message-id:to:from:from:subject:subject :date:date; s=dkim; t=1651580506; x=1652444507; bh=BvPpK5stZNVoD yOyAoIFeuyKSJuOttJb/7adpyKh84w=; b=C8nfoPCfrPcoMR3GF9e/JElq08OEq GMq9g+D4hcBpH6bIwfF1L1NlYp2saUohbSSQLiDfvErZg4GxM3eNaoULcWLZ+Ub5 A1z4gxj3K5CkfbZkty19rOxXsmif4o3ehCXdQTRfLPAsSZU9Z0A7b0IrxGyHh+BZ vkueL1tOgDCrME= X-Virus-Scanned: Debian amavisd-new at mx.zeyos.com Received: from mx.zeyos.com ([127.0.0.1]) by mx.zeyos.com (mx.zeyos.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 2X_uEp_WZrqv for ; Tue, 3 May 2022 14:21:46 +0200 (CEST) Received: from cloud.zeyos.com (static.182.82.88.23.clients.your-server.de [23.88.82.182]) by mx.zeyos.com (Postfix) with ESMTPSA id 845C26205A; Tue, 3 May 2022 14:21:46 +0200 (CEST) Date: Tue, 03 May 2022 14:21:46 +0200 Subject: Re: Useless memoize path generated for unique join on primary keys From: Benjamin Coutu To: David Rowley Cc: pgsql-performance Message-ID: <052166fdb31e17b9ef89@zeyos.com> In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > I'd say it's a pretty different problem. The cache hit ratio > discussion on that thread talks about underestimating the hit ratio. > That particular problem could only lead to Memoize plans *not* being > chosen when they maybe should be. Not the other way around, which is > your case. >=20 > create statistics extdataregular_field_index_stats (ndistinct) on > field, index from extdataregular; > analyze extdataregular; >=20 > would likely put that right.=0A=0AThanks David, using extended statistics= for both (and only for both) tables solved this problem.=0A=0ABTW, thank y= ou for all your work on performance in recent releases.