Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1edS5z-000540-Pf for pgsql-hackers@arkaria.postgresql.org; Mon, 22 Jan 2018 02:44:27 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1edS5z-0008PQ-1U for pgsql-hackers@arkaria.postgresql.org; Mon, 22 Jan 2018 02:44:27 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1edS5y-0008PG-Kw for pgsql-hackers@lists.postgresql.org; Mon, 22 Jan 2018 02:44:26 +0000 Received: from mail-pg0-x244.google.com ([2607:f8b0:400e:c05::244]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1edS5r-0002XA-Px for pgsql-hackers@postgresql.org; Mon, 22 Jan 2018 02:44:25 +0000 Received: by mail-pg0-x244.google.com with SMTP id y27so5988416pgc.5 for ; Sun, 21 Jan 2018 18:44:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=Pq+KYrqbMHRnvIUwpKL47TQDAEa9EDuvgRdPXTBRnHo=; b=gNN+4w19Q4MFtmiwuG9Nlf4FbMWq1cyGjt+Dr71BciAqO9J/SLDx0Xp8RJcDgM1TTO wjVb/Sw4GVjKrB/9Rh2atzrd77u2m7u3/wuQZ4GSd2aQhBfiGv2tjv5oMa5gELhS2pIw XF5Db0BXsdyiIs0qqCVywKppz6C0Z7s9GGHKJHJ6MOfwAvX6RrEOKsm3UwX/NvMzoWt4 0lR3O3FveSbHRhktyXbB5/NvVbPafc47+kXMI5iCyFln67IQVDsmbw3EGA28kgsFeXAZ ehg7JQWXcTJrPuF9WGtgF7xngCDnzlYz7Z1ywQ+wM5gDGioQhd1v4zbD8wUgX2INja9P NzuA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=Pq+KYrqbMHRnvIUwpKL47TQDAEa9EDuvgRdPXTBRnHo=; b=geZOVgXTr5gN1A0psq4E3XGz3xLVpjm1wze13T+N9dt3sFJBsfIdxY5tnjKLZiln7L PzbZOyf1TgbU28DYXdI/acT3LjzCEHesdMabW5LGG3svN74doUYWY7Fsa9ybgo74gTDC TejF/F5gj+wgSa0xs1E9J4pqRkzEE5VwzRekpIIRAnVEucPn7S2C+7tJAFk9VaPx+PrF gJ/Yh0Lkai4Ga+QbZusSa6OVpXqX3WqzXpjS6jWyDCOQDlKnPQXSv38cELuLKn6vBc03 zmZsnwWRaQiygmXd0SzaAOiYimgNXV1Pekq7RG34deJSimHeqrh4Yqz6dR2i0D5MhHQ3 mf5g== X-Gm-Message-State: AKwxytdDA2ZT758JyWglNHOdwxsnNkRlV/lZl88P/5o0uwxAKufPFMPE FkrpOtBhO1qhotCa5ieg0HI= X-Google-Smtp-Source: AH8x226u/AeeiQqGwg9TJSulaws50gX/64edHwYJBIyPrIXtkOlLM9VI7cuSPpeSl2zwJ9JCuTHc/Q== X-Received: by 10.98.7.73 with SMTP id b70mr6811174pfd.39.1516589058348; Sun, 21 Jan 2018 18:44:18 -0800 (PST) Received: from paquier.xyz (c137162.net61215.cablenet.ne.jp. [61.215.137.162]) by smtp.gmail.com with ESMTPSA id s14sm27135308pfa.158.2018.01.21.18.44.15 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 21 Jan 2018 18:44:16 -0800 (PST) Date: Mon, 22 Jan 2018 11:44:07 +0900 From: Michael Paquier To: David Rowley Cc: Amit Langote , Peter Eisentraut , Robert Haas , Pg Hackers Subject: Re: [Sender Address Forgery]Re: pg_(total_)relation_size and partitioned tables Message-ID: <20180122024407.GA1772@paquier.xyz> References: <1a78dea4-36b7-afb7-b3f3-1b4ff319fbb4@lab.ntt.co.jp> <93bef1b2-2ed0-c257-158e-efdf5b0ff9dd@2ndquadrant.com> <8ecdd7fb-02d5-4322-526a-e49e2de25064@lab.ntt.co.jp> <20180119053958.GD12826@paquier.xyz> <7a9c5328-5328-52a3-2a3d-bf1434b4dd1d@lab.ntt.co.jp> <20180120101454.GA1311@paquier.xyz> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="vtzGhvizbBRQ85DL" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --vtzGhvizbBRQ85DL Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Jan 21, 2018 at 07:16:38PM +1300, David Rowley wrote: > On 20 January 2018 at 23:14, Michael Paquier = wrote: >> If pg_partition_tree_tables() uses the top of the partition as input, >> all the tree should show up. If you use a leaf, anything under the leaf >> should show up. If a leaf is defined and it has no underlying leaves, >> then only this outmost leaf should be listed. >=20 > hmm, that's thoroughly confusing. Just in case anyone else is stuck on > that, I just need to mention that a leaf is the does not have > branches, in nature or computer science. OK, sorry if my words are confusing. Imagine that you have the following partition set: p / \ / \ p1 p2 / \ / \ p21 p22 If pg_partition_tree_tables() uses 'p' as input argument, then I would imagine that it should return p, p1, p2, p21 and p22. If 'p2' is used, then p2, p21 and p22 are the results. If either one of p1, p21 or p22 is used as input, then the result is respectively p1, p21 or p22. Amit's patch seems to be doing that kind of logic by using find_all_inheritors, which is good. We need to make the difference between relations that are part of a partition set and the other ones which are part of an INHERIT link, and, at least it seems to me, the patch is not careful with that. I haven't tested what is proposed though, but this portion likely needs more thoughts. -- Michael --vtzGhvizbBRQ85DL Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAlplT/cACgkQnvQgOdby QH35CBAAoUNM7gd3IB0Ag7uYFQOp/0pn9p2omssU0UhJAgKHpVSngxBNrX8eOcHd 8F8j1THSQcCK9f2V9tzb6vX1W1ifh7MyRNjd5mbTjfRFsNXjqxCkFEoORTuLQsd3 WD/wb8szTbUTiEa8NJZjFF7LCr0unUWmIBrj+UDuwIyIb9gWBHlqWN0K/IuxGQr1 2mSVfMUK2Q5mtXB32/3uvmKGU4AKy48F5M5J4eBE2S705aWoXmn3LwVRHuOcAovb /YcjNDUfmG6IYAIvRlR8iBC2jpFTFkj9c0ylv0ZZ+Tu24N2t83h2pGoYJDSoYvw3 nwMt7ULgXKXwlQpu0owosxWSWOngwUrUXLPZYngwaWYxmA6tGOTaVhUVtKc3IGp3 hOeMncbJnfHG0uUNf/6QQHjAWD5gI7dCRtr6rrnhEpzlVo5aYgkqq81WX3VtTDRC CmEyal/qfIqfmXvwdg7JOhKMYntzSVmBOlvlUJxSJV1Iyjo4STOc43hZFDru9CEj U8pIyJmkCjIyHd053QOCuP9x/S1DVSS+XR7r52cz60YQaYTPrW7LnQJt/8E3ktvs oRBocVbxiZ0G2LEgb8NlVmTuvQzfhBqJ5yubODmorCwv0d8veVr36KIvvFDpPekf reVXFS0MjMNlX8y/Vb59lqYR8RYhxrqJLEnu1YhuAL7ysldym14= =/XdL -----END PGP SIGNATURE----- --vtzGhvizbBRQ85DL--