[英]Partitioned MySQL table in Django
Is it possible to create a partitioned MySQL table in Django?是否可以在 Django 中创建一个分区的 MySQL 表? Any example in that front will be really helpful.
这方面的任何例子都会非常有帮助。
I did as like the below by using sql hook of django:我使用 django 的 sql 钩子做了如下操作:
yourmodelname.sql file: yourmodelname.sql 文件:
DROP TABLE <table name>;
CREATE TABLE `<table name>` (
`id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
`testcase_id` integer NOT NULL,
`databytes` integer NOT NULL,
`direction` integer NOT NULL,
`seconds` integer NOT NULL
) PARTITION BY LINEAR KEY (id) PARTITIONS 4;
COMMIT;
You don't need to involve Django at all.您根本不需要涉及 Django。 Just do table partitioning in plain mysql
只需在普通 mysql 中进行表分区
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.