Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1faI0Q-0001BJ-8N for pgsql-committers@arkaria.postgresql.org; Tue, 03 Jul 2018 09:53:54 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1faI0O-0005Mx-CY for pgsql-committers@arkaria.postgresql.org; Tue, 03 Jul 2018 09:53:52 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1faI0O-0005Mp-7Z for pgsql-committers@lists.postgresql.org; Tue, 03 Jul 2018 09:53:52 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1faI0L-0007F5-MA for pgsql-committers@postgresql.org; Tue, 03 Jul 2018 09:53:51 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 0F17921B6A; Tue, 3 Jul 2018 05:53:48 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Tue, 03 Jul 2018 05:53:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= cc:content-type:date:from:in-reply-to:message-id:mime-version :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=fEDP7PR8fsAJhe2lYMgDI0LSa34c6XVWM1GQWJ0nJuQ=; b=SgXXZ+HH GFSnLZwTV0EK8+KIn5G4WSsVvI0ML6Uo/0lAHQCoVgno6XGqIxB9KsRgPFyhpioX eusxEBtLzZ6QX3DUu3tlyQM22CviRnlsfF5q59mY6J0oPabxkw0V+/FM2FYHxp6/ 7Zq1eujujAwLgxwFSdGxgmbcKjim6HesJ8Ve1DBI+YVdu2IDKJNYIxb159WopD0I cCGZhCZTfaaGG2QWaH6B0F7duCUXbRLRN9UcgpaZiF0rvr6gG0xLW3fphsgfQafV UHdQbH3fH17XSwlJjskTH/RvS7uk5fzmQx3Q0DeBNMIIFOGbwnwFQ/EaHaUPgZDQ eYxt9BVN0ZXUSw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; bh=fEDP7PR8fsAJhe2lYMgDI0LSa34c6 XVWM1GQWJ0nJuQ=; b=qc2lH6cQv8VzETIeXOKD8aQjSHGodPFCiGT4Bj839JQxQ GKYsfQhlmQ2/9zc+corZTWRXRVq8sbxScqZ+U3VRQxsYOEkjabBY3q8xRftJO3OX CmMQ5ICISWhtESUc7i9v68kdUvyz2L/qOPg8KIgJp19OvWAO8THvqOD7Um6edILF 8YkIKPeePcyJmgqG53qYY/prFL8mgqO3YH1eCBtf93Vjo7ALUOR/UKAKBEx+/m7U arbfmzs1tRNA048w5I6RypNa4F/UYksb3rtRvpCVi/bbP9VH96gYcoArXsFbK7xL eEIxqiJBBSDI1x6dcyzycrPYGdN7VY3BlUcxVmVbQ== X-ME-Proxy: X-ME-Sender: Received: from paquier.xyz (c137162.net61215.cablenet.ne.jp [61.215.137.162]) by mail.messagingengine.com (Postfix) with ESMTPA id D330A10326; Tue, 3 Jul 2018 05:53:45 -0400 (EDT) Date: Tue, 3 Jul 2018 18:53:43 +0900 From: Michael Paquier To: David Rowley Cc: Amit Langote , Robert Haas , Ashutosh Bapat , pgsql-committers Subject: Re: pgsql: Clarify use of temporary tables within partition trees Message-ID: <20180703095343.GE11732@paquier.xyz> References: <20180703061119.GA11732@paquier.xyz> <5db5fe6e-4a73-6a24-09e4-060b9f132ea9@lab.ntt.co.jp> <20180703070551.GC11732@paquier.xyz> <20180703091507.GD11732@paquier.xyz> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="5oH/S/bF6lOfqCQb" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --5oH/S/bF6lOfqCQb Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jul 03, 2018 at 09:30:20PM +1200, David Rowley wrote: > On 3 July 2018 at 21:15, Michael Paquier wrote: > > Yeah. Actually I'd like to add a test as well to test the recursion > > call of expand_partitioned_rtentry. If you have an idea, please let me > > know or I'll figure out one by myself and add it probably in > > create_table.sql. >=20 > What specifically do you want to test? There are plenty of partitioned > tests with sub-partitioned tables. Going by [1], there's no shortage > of coverage. >=20 > Of course, the dead code I'm proposing we remove is not covered. > There's no way to cover it... it's dead. Your patch removes this part: - /* - * If the partitioned table has no partitions or all the partitions are - * temporary tables from other backends, treat this as non-inheritance - * case. - */ - if (!has_child) - parentrte->inh =3D false; And adds this equivalent part: + /* + * If the partitioned table has no partitions, treat this as the + * non-inheritance case. + */ + if (partdesc->nparts =3D=3D 0) + { + parentrte->inh =3D false; + return; + } As far as I can see from the coverage report, the former is not tested, and corresponds to the case of a partition leaf which is itself partitioned but has no partitions, and the new portion is equivalent to the part removed. That ought to be tested, particularly as Amit mentions that there could be improvements with moving it around in future versions. -- Michael --5oH/S/bF6lOfqCQb Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAls7R6cACgkQnvQgOdby QH0xyA//SJ4rMiI/NnMeCAC1MTL54RnA4j6sqvXcshfYA5M9E4ayd/ctOvrLycRA SaSKNLIoPrBsS/vdknTyJjlU2q6gSdkaFJM7EctRjGHr7ztp7ObV6XacFlBLETEq C+xe2PSpQvL+I3qvnfn+2ttZawwmQSADa91ESdI+Xomy/OupxIXknOmasRpoiT0t Dda1AvyW2ZC1tByxn8sCNBB6GZaYfn1a8Px3P8OzgZG6uJp98axA1wnoC/Z0L5Bd hEfjuNdJtFLeF9O+PbWPebsxP5shO/oVhYUHxHEg9S22UMgfFmMlPOiBqrdiTrjH WxiVVUhQuXeDOnUTk0g1PrCadHroVBDUYQdiOTJJhmH9wb6G8a3hcgZYrgd/3B9e OMID3HRwxQq9p2vpELa8ojAOAfLwWSiSrRkgx59R7VuMSN/mfr5BkaST77mWubEY liVuk2XAsOZt3Uu1TDV+8Lj06cfMqr9926526aO44/FEARRVIgXCRSoXqRKenN3a FPWoPJCby64KDFMFbT+4goOUHmfzzwA3/WM5jD0EoNQdjeZJ2AUxRCJh9lkcTWOq NRsjBY1ET/umqBiaEMCY8xYnmeAu29SwJ8NoyZXK7yg4hJHHBoa+IIOGs9gPR/VT Qk7LAvssajKKlTbX/r0IRWEUgcUbr9sSvAlUxID/T/th1yfj/dw= =Q9/J -----END PGP SIGNATURE----- --5oH/S/bF6lOfqCQb--