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 1mTSOY-0005QU-U8 for pgsql-hackers@arkaria.postgresql.org; Thu, 23 Sep 2021 17:20:27 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mTSOX-0000Gm-Rn for pgsql-hackers@arkaria.postgresql.org; Thu, 23 Sep 2021 17:20:25 +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 1mTSOX-0000Gd-Hd for pgsql-hackers@lists.postgresql.org; Thu, 23 Sep 2021 17:20:25 +0000 Received: from mxout4.routing.net ([2a03:2900:1:a::9]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mTSOQ-0007Ir-Dz for pgsql-hackers@postgresql.org; Thu, 23 Sep 2021 17:20:24 +0000 Received: from mxbox2.masterlogin.de (unknown [192.168.10.89]) by mxout4.routing.net (Postfix) with ESMTP id D227010087D for ; Thu, 23 Sep 2021 17:20:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailerdienst.de; s=20200217; t=1632417613; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type; bh=zSMyZOL08nUNdCnRIcw0K/ypz5Gfon+M50DUTybzUEE=; b=S7IWjKDZBA71+mSWLZYaTUFYm3zafw7PBAQ4Pz3J0Ng/1WoawAVKyIt59F218xpcjEQXyU QdldfCDKci3AlO08aL6Z/PnT6nyW47J1mENyuWV4Fq4TcxrSgQUc9p/AodZZsxh1itH87U 1kIaoM69sZfMj0m3ZRpaqKuyFIX2K0A= Received: from remote.index.de (business-90-187-114-221.pool2.vodafone-ip.de [90.187.114.221]) by mxbox2.masterlogin.de (Postfix) with ESMTPSA id 6F6351001D3 for ; Thu, 23 Sep 2021 17:20:13 +0000 (UTC) Received: from acedia.index-gruppe.local (192.168.3.121) by invidia.index-gruppe.local (192.168.3.140) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.14; Thu, 23 Sep 2021 19:20:10 +0200 Received: from acedia.index-gruppe.local ([fe80::d80d:6d0c:3192:2a5f]) by acedia.index-gruppe.local ([fe80::d80d:6d0c:3192:2a5f%13]) with mapi id 15.01.2176.014; Thu, 23 Sep 2021 19:20:09 +0200 From: Arne Roland To: pgsql-hackers Subject: missing indexes in indexlist with partitioned tables Thread-Topic: missing indexes in indexlist with partitioned tables Thread-Index: AQHXsJoeXw6ojQG4NkOLdiX4KUBdDw== Date: Thu, 23 Sep 2021 17:20:08 +0000 Message-ID: Accept-Language: en-US, de-DE Content-Language: en-US X-MS-Has-Attach: yes X-MS-TNEF-Correlator: x-originating-ip: [10.255.1.33] Content-Type: multipart/mixed; boundary="_004_c3b2408b7a39433b8230bbcd02e9f302indexde_" MIME-Version: 1.0 X-Mail-ID: 81adb779-0a0e-4dd3-9231-2e72eeed9308 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --_004_c3b2408b7a39433b8230bbcd02e9f302indexde_ Content-Type: multipart/alternative; boundary="_000_c3b2408b7a39433b8230bbcd02e9f302indexde_" --_000_c3b2408b7a39433b8230bbcd02e9f302indexde_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi, I did a bit of testing today and noticed that we don't set indexlist proper= ly at the right time in some cases when using partitioned tables. I attached a simple case where the indexlist doesn't seems to be set at the= right time. get_relation_info in plancat.c seems to process it only after = analyzejoins.c checked for it. Can someone explain to me why it is deferred at all? Regards Arne --_000_c3b2408b7a39433b8230bbcd02e9f302indexde_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable

Hi,


I did a bit of testing today and noticed that we don't set indexli= st properly at the right time in some cases when using partitioned t= ables.


I attached a simple case where the indexlist doesn't seems to be set at = the right time. get_relation_info in plancat.c seems to process i= t only after analyzejoins.c checked for it.


Can someone explain to me why it is deferred at all?


Regards

Arne


--_000_c3b2408b7a39433b8230bbcd02e9f302indexde_-- --_004_c3b2408b7a39433b8230bbcd02e9f302indexde_ Content-Type: application/sql; name="indexlist_to_late.sql" Content-Description: indexlist_to_late.sql Content-Disposition: attachment; filename="indexlist_to_late.sql"; size=296; creation-date="Thu, 23 Sep 2021 17:17:33 GMT"; modification-date="Thu, 23 Sep 2021 17:17:33 GMT" Content-Transfer-Encoding: base64 Y3JlYXRlIHRhYmxlIHB1YmxpYy5hIChpZCBiaWdpbnQgbm90IG51bGwgcHJpbWFyeSBrZXkpIHBh cnRpdGlvbiBieSByYW5nZSAoaWQpOwpjcmVhdGUgdGFibGUgYiBwYXJ0aXRpb24gb2YgYSBmb3Ig dmFsdWVzIGZyb20gKDApIHRvICgxMDAwKTsKCi0tIHdvcmtzIGFzIGV4cGVjdGVkCmV4cGxhaW4g c2VsZWN0IGEuaWQgZnJvbSBhIGxlZnQgam9pbiBiIHVzaW5nIChpZCk7Ci0tIGluZGV4bGlzdCBp cyBzZXQgdG8gbGF0ZQpleHBsYWluIHNlbGVjdCBhLmlkIGZyb20gYSBsZWZ0IGpvaW4gYSBhMSB1 c2luZyAoaWQpOwo= --_004_c3b2408b7a39433b8230bbcd02e9f302indexde_--