pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Reference-Partitioned Tables
2+ messages / 2 participants
[nested] [flat]

* Reference-Partitioned Tables
@ 2020-11-06 15:56 Сергей _ <argonaut.od@gmail.com>
  2020-11-07 08:20 ` Re: Reference-Partitioned Tables Alvaro Herrera <alvherre@alvh.no-ip.org>
  0 siblings, 1 reply; 2+ messages in thread

From: Сергей _ @ 2020-11-06 15:56 UTC (permalink / raw)
  To: pgsql-general@lists.postgresql.org

Hi,

There is a proposal to include in future developments sectioning by
reference, as in Oracle

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.


[image: contracts.jpg]

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.

Thanks, best wishes.

Attachments:

contracts.jpg (image/jpeg, 139.3K) download view image
^ permalink raw reply [nested|flat] 2+ messages in thread

* Re: Reference-Partitioned Tables
  2020-11-06 15:56 Reference-Partitioned Tables Сергей _ <argonaut.od@gmail.com>
@ 2020-11-07 08:20 ` Alvaro Herrera <alvherre@alvh.no-ip.org>
  0 siblings, 0 replies; 2+ messages in thread

From: Alvaro Herrera @ 2020-11-07 08:20 UTC (permalink / raw)
  To: Сергей _ <argonaut.od@gmail.com>; +Cc: pgsql-general@lists.postgresql.org

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.





^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2020-11-07 08:20 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2020-11-06 15:56 Reference-Partitioned Tables Сергей _ <argonaut.od@gmail.com>
2020-11-07 08:20 ` Alvaro Herrera <alvherre@alvh.no-ip.org>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox