how to drop partition without dropping data in MySQL?
ALTER TABLE tbl REMOVE PARTITIONING; Source: ALTER TABLE Statement in MySQL Reference Manual
ALTER TABLE tbl REMOVE PARTITIONING; Source: ALTER TABLE Statement in MySQL Reference Manual
In Postgres 10 “Declarative Partitioning” was introduced, which can relieve you of a good deal of work such as generating triggers or rules with huge if/else statements redirecting to the correct table. Postgres can do this automatically now. Let’s start with the migration: Rename the old table and create a new partitioned table alter table … Read more
One way: The best way I found to do this is using RunSQL: Migrations contains the RunSQL class. To do this: ./manage.py makemigrations –empty myApp edit the created migrations file to include: operations = [ migrations.RunSQL(‘RAW SQL CODE’) ] As Nathaniel Knight mentioned, RunSQL also accepts a reverse_sql parameter for reversing the migration. See the … Read more
Partitioning is a rather general concept and can be applied in many contexts. When it considers the partitioning of relational data, it usually refers to decomposing your tables either row-wise (horizontally) or column-wise (vertically). Vertical partitioning, aka row splitting, uses the same splitting techniques as database normalization, but ususally the term (vertical / horizontal) data … Read more
Partitioning is more a generic term for dividing data across tables or databases. Sharding is one specific type of partitioning, part of what is called horizontal partitioning. Here you replicate the schema across (typically) multiple instances or servers, using some kind of logic or identifier to know which instance or server to look for the … Read more