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 1uADaM-00CLNr-MA for pgsql-general@arkaria.postgresql.org; Wed, 30 Apr 2025 19:59:15 +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 1uADaK-00G4S1-Mw for pgsql-general@arkaria.postgresql.org; Wed, 30 Apr 2025 19:59:13 +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 1uADaK-00G4Rt-CZ for pgsql-general@lists.postgresql.org; Wed, 30 Apr 2025 19:59:13 +0000 Received: from mail-oi1-x232.google.com ([2607:f8b0:4864:20::232]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1uADaJ-000P8S-1v for pgsql-general@lists.postgresql.org; Wed, 30 Apr 2025 19:59:12 +0000 Received: by mail-oi1-x232.google.com with SMTP id 5614622812f47-3feaedb39e9so123893b6e.1 for ; Wed, 30 Apr 2025 12:59:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1746043151; x=1746647951; darn=lists.postgresql.org; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=kZ5SkoR+aTtYPMByvXPKkGgdvCb+kH+DzYEgIMyfkjo=; b=iOuQ4D0ypBfon8A715N3jLGoNfZ1tdG/+cOl0VhuiZjHDbFuBgF+bhDZ6npB2lVHyY B6CUGMvCQMZ5HN9FLOpgUKUIBZ9jmDE/LR7/a5BOo6fDDi8AM8E0a9aBuo8v0eweTOts 2ZABdfllYKf//JqBd6mtg1H5j2FLHzxqlEqhVWeYh+NXb9MUPJV0UUaeit04mgFsJw6D HO1xY5SkWto5gxoMqR/3aNzS5Rq2wooFxN+iAeQen+8uTuNZBE8kIRWEdXBY5qFoPJrR couog95PyeMxQRw1Q1xvZy7skr3NLBQ0P5QNZ+N/QOD5Ie3DSqinXFljJLpLBcJ+KpVa oOQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1746043151; x=1746647951; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=kZ5SkoR+aTtYPMByvXPKkGgdvCb+kH+DzYEgIMyfkjo=; b=XQieFiPBe82cq2EPleAkZoHtwSBkKpxNdC3Ocj1OOqQFfE81S8wLq+CR9EZtiX4rOq ByqFEdrcTQaGE7YGdfy4hGLTUyk+s2M7rVq/TCDG5cF1ezFrVdC9GyefdCBOBR53Q4gf a7m4rqjFb+wbZx08US+xalHskW1etkzEZNncEdp5lCUuqeE3VpId9ujzUso0oLWhTIBs 2GibfqIte0ZzIoGwRVkg0Ho9txczZP2OwuBuZIO+rPozonQP8XYeu/dULYTpTsN2sTZq qzDmc0xQCYeSlkNcJZRxRBdubIfBj6Qh2R96CmdqmbSKaaG9L66mkjtsaLJTOWJbt/+9 MWcQ== X-Gm-Message-State: AOJu0Yw7ZKcrP2pX2xARs9SBobVu9QPrkWvfMYY+oCBAeSMpgIPq8Ffo I0/a6LMkMzezNc/GTIqUkDIQl7uvnhW+/Qqp4Q1aaEVjFNJVYbnBFo3EZzXrxEHITcJJ1eWR0vc mILqFwU44GfchFb9gTftu3/6h2vOkog== X-Gm-Gg: ASbGncswoK2kbwW1AF9kJOqm/Xskvodk5+2NUGzISadnmjcsZF+4XMfNNZsBRXtSKxv b9gs6wYffVkISnztfGd0mIrkJqVFes62zlJB73AZOir0Sizv5UIfoD9tPZH6EdXTkqqMWfTXCd8 J0YP/ZPt+5d+WASLfvq18aqJ8= X-Google-Smtp-Source: AGHT+IGYV1DWMn+m6DhMZNZtsoo0u3SboGcpLzVc9V59Ed43F/lQGIlJHtC2PIeldP5ApKdQNmOnfcMN81EpGTbo2ck= X-Received: by 2002:a05:6808:23cd:b0:403:3521:2475 with SMTP id 5614622812f47-403352125cdmr66514b6e.37.1746043150887; Wed, 30 Apr 2025 12:59:10 -0700 (PDT) MIME-Version: 1.0 References: <20250430151647.7kootztymzznydn5@victor> In-Reply-To: <20250430151647.7kootztymzznydn5@victor> From: Ron Johnson Date: Wed, 30 Apr 2025 15:58:59 -0400 X-Gm-Features: ATxdqUGPxcQcGuVXLb6_hU3FSLXqVizEz1sAJ_RZGd7CWVeepFpWjlTzFI7TiDU Message-ID: Subject: Re: Index not used in certain nested views but not in others To: "pgsql-generallists.postgresql.org" Content-Type: multipart/alternative; boundary="000000000000c56fd50634045955" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000c56fd50634045955 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, Apr 30, 2025 at 3:51=E2=80=AFPM Markus Demleitner < msdemlei@ari.uni-heidelberg.de> wrote: > Dear List, > > I know how tedious mails with a subject of the type "I don't understand > what the planner does" are, but on this one I'm really stumped. > Regrettably, the situation is also a bit complex. Hopefully, someone > will bear with me. > > So, in a PostgreSQL 15.12 I have a view over a single table with ~20 > columns (the only relevant columns here are the ones that somehow > contain "pub[lisher]_did", the others are just there for context; I'm > going to call these "pubdids" from here on in the prose): > [snip] > Is there anything that would explain that behaviour given I've switched > off the genetic optimiser and postgres has hopefully exhaustively > searched the space of plans in both cases? > Are the tables regularly analyzed and vacuumed? (The default autovacuum analyze threshold of 20% is pretty high.) --=20 Death to , and butter sauce. Don't boil me, I'm still alive. lobster! --000000000000c56fd50634045955 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Wed, Apr 30, 2025 at 3:51=E2=80=AFPM M= arkus Demleitner <msde= mlei@ari.uni-heidelberg.de> wrote:
Dear= List,

I know how tedious mails with a subject of the type "I don't under= stand
what the planner does" are, but on this one I'm really stumped. Regrettably, the situation is also a bit complex.=C2=A0 Hopefully, someone<= br> will bear with me.

So, in a PostgreSQL 15.12 I have a view over a single table with ~20
columns (the only relevant columns here are the ones that somehow
contain "pub[lisher]_did", the others are just there for context;= I'm
going to call these "pubdids" from here on in the prose):
[snip]=C2=A0
Is there anything that would explain that behaviour given I've s= witched
off the genetic optimiser and postgres has hopefully exhaustively
searched the space of plans in both cases?

Are the tables regularly analyzed and vacuumed?=C2=A0 = (The default=C2=A0autovacuum analyze threshold of 20% is pretty high.)

--
Death to <Redacted= >, and butter sauce.
Don't boil me, I'm still alive.
<Redacted> lobster!
--000000000000c56fd50634045955--