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 1kbJTA-0005vU-I5 for pgsql-general@arkaria.postgresql.org; Sat, 07 Nov 2020 08:21:08 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kbJT7-0003Ad-Q5 for pgsql-general@arkaria.postgresql.org; Sat, 07 Nov 2020 08:21:05 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kbJT6-0003AW-V3 for pgsql-general@lists.postgresql.org; Sat, 07 Nov 2020 08:21:05 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kbJSy-0001sq-QM for pgsql-general@lists.postgresql.org; Sat, 07 Nov 2020 08:21:04 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 82E615C005A; Sat, 7 Nov 2020 03:20:53 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Sat, 07 Nov 2020 03:20:53 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=IjDmmCMtcsxldQ53D7meebsiGo8D2NmeATRFEfvmvjA=; b=BvzEtHj8 uanL3zEUo7sh7GCZpnta+inNg+nM9URNGKSmu/DCoHeP1mFX0l45mJ7VyP8QoSzZ RkzaFv9oQUJw9el2h6+9XjZenwClQxaSRMTZxIf3Ynz9D5mz/pu11GT06r1T89xP 7pjHIKWjd+SWBmfPErWSra1zAeLJpDvZOIQFHKJylPJaYPHRsJe4p8C2XhtKjn2V Rs8RdfSJ6Qv2+n2FSbRT7iCrYIxk0htlPZWEJvPvKNM8WFUDBuVExhoMkTO3hB52 Qc/uF86BdQTFANdeYNn3LwZtyun8OtZe7eGESIhL/LzwLpX0DiqWM4Q0lEuZx2AZ 6L319CXUTRnAyA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedruddutddguddujecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhepfffhvffukfggtggugfgjfgesth ekredttderjeenucfhrhhomheptehlvhgrrhhoucfjvghrrhgvrhgruceorghlvhhhvghr rhgvsegrlhhvhhdrnhhoqdhiphdrohhrgheqnecuggftrfgrthhtvghrnhepteethfeuve elkeelgedutddvgeegfffgleduhfelueeuffekheehtedtgefhvedvnecuffhomhgrihhn pehorhgrtghlvgdrtghomhenucfkphepudeltddrleehrdduledrudegkeenucevlhhush htvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrlhhvhhgvrhhrvges rghlvhhhrdhnohdqihhprdhorhhg X-ME-Proxy: Received: from perhan.alvh.no-ip.org (unknown [190.95.19.148]) by mail.messagingengine.com (Postfix) with ESMTPA id F1FD5306005C; Sat, 7 Nov 2020 03:20:52 -0500 (EST) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id 79AE22A154D; Sat, 7 Nov 2020 05:20:50 -0300 (-03) Date: Sat, 7 Nov 2020 05:20:50 -0300 From: Alvaro Herrera To: =?utf-8?B?0KHQtdGA0LPQtdC5?= _ Cc: pgsql-general@lists.postgresql.org Subject: Re: Reference-Partitioned Tables Message-ID: <20201107082050.GA25101@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2020-Nov-06, Сергей _ wrote: > https://docs.oracle.com/database/121/VLDBG/GUID-00923EB3-05F6-41F7-8437-E42FC9BD9571.htm#VLDBG1093 > > There is a widespread model when data related to properties of a superclass > is stored in a base table, and data related to subclasses in a detail table. Or > when the main entity has volatile additional parameters. A very simplified > example in the attached image. Sounds easier to achieve by using a JSONB column that holds all the contract details. > The most successful choice of partitioning table *Contracts* is sectioning > by list with key column *ContractTypeID*. It would be nice if the table > *ContractDetails* is partitioned automatically like the parent table > *Contracts*. Then we don't have to add a crutch column *ContractTypeID* to > the table* Contract**Details* and partition manually in sync with > *Contracts*. This field also consumes disk space, since the table of details > is usually large and there can be more than one partitioning key. Hmm, so you want to partition a table based on values appearing in another table. I wouldn't hold my breath waiting for this.