dbal icon indicating copy to clipboard operation
dbal copied to clipboard

Partitioning Support in Doctrine for Relational Database

Open cs-alok-agarwal opened this issue 4 years ago • 12 comments

Partitioning Support in Doctrine for Relational Databases

Q A
New Feature yes
RFC no
BC Break no

Summary

Request a support for partitioning support in native doctrine. https://www.postgresql.org/docs/12/ddl-partitioning.html

Main Challenge in implementing partitioning currently is, partitioning needs to be defined while create table itself. Currently as the option is not available we cannot use same

From Postgres Documentation: _It is not possible to turn a regular table into a partitioned table or vice versa. However, it is possible to add an existing regular or partitioned table as a partition of a partitioned table, or remove a partition from a partitioned table turning it into a standalone table. Link

Similar to index or unique constraint support we can have partitioning column support too for Databases. Like partition_option({"type": "range", column: "date", max_partition: 40})

cs-alok-agarwal avatar May 24 '21 17:05 cs-alok-agarwal

I'm looking for this feature !

pierre-cba avatar Jul 08 '21 11:07 pierre-cba

I don't think we can just add a platform-specific feature to the DBAL API. Even if partitioning is supported by multiple platforms, there are high chances that their APIs and capabilities are different. The only reasonable way to support features like this is to break the Platform API down to smaller pieces and make them extensible independently. Something along the lines documented in https://github.com/doctrine/dbal/issues/3731.

morozov avatar Jul 14 '21 20:07 morozov

I second this! Horizontal partitioning is a powerful feature for large datasets where newer entries are accessed more frequently than older entries. If Doctrine can natively support this it would be a HUGE feature add. The amount of work required to manually implement this is huge and could definitely be simplified.

Sales pitch aside, I also am an advocate for #3731 as this opens a door to exploring platform specific features, and to my knowledge has no downsides (much like how Symfony is structured).

SteppingHat avatar Mar 31 '22 14:03 SteppingHat

Also this isn't PostgreSQL specific, MySQL/MariaDB supports this too.

SteppingHat avatar Mar 31 '22 14:03 SteppingHat

Hi, we need this too. Is there a workaround we can implement (in code) in the meantime, to get doctrine:schema:validate correctly validate our table with partitions?

BenMorel avatar Apr 03 '23 16:04 BenMorel

Hello, we need this too. Its important feature!

digitaltim-de avatar Sep 20 '23 11:09 digitaltim-de

Hello, we need this too. Its important feature!

Go ahead and build that feature, then.

derrabus avatar Sep 20 '23 20:09 derrabus

Hello, we need this too. Its important feature!

Go ahead and build that feature, then.

Rather than being sarcastic, maybe there is some guidelines, how we can approach this?

vytsci avatar Feb 21 '24 15:02 vytsci

Rather than being sarcastic

Nobody's being sarcastic. This is a community-driven open source project. If you want a change to happen, make it happen.

derrabus avatar Feb 21 '24 18:02 derrabus