› MySQL 5.5 Community Server
› MySQL 5.6 Community Server
› Percona Configuration Wizard
› XtraBackup 搭建主从复制
Great Sites on MySQL
› Percona
› MySQL Performance Blog
› Severalnines
推荐管理工具
› Sequel Pro
› phpMyAdmin
推荐书目
› MySQL Cookbook
MySQL 相关项目
› MariaDB
› Drizzle
参考文档
› http://mysql-python.sourceforge.net/MySQLdb.html
whitecats
V2EX  ›  MySQL

我有个 7000w 的 mysql 表,想把 3 个月以前的数据放到一个归档表中,有什么高效点的办法吗?

  •  
  •   whitecats · Apr 18, 2024 · 3101 views
    This topic created in 937 days ago, the information mentioned may be changed or developed.
    4 replies  •  2024-04-18 16:37:33 +08:00
    airqj
    airqj
    Apr 18, 2024
    1
    新建一张一模一样的表存放最近三个月的数据
    然后旧表改名
    ElmerZhang
    ElmerZhang
    Apr 18, 2024
    2
    如果三个月以前的数据量比较大,就建个新表把近三个月的拷出来,然后把两个表改名。
    否则的话只能建个归档表慢慢拷。拷之前别建索引,拷完再建索引。
    whitecats
    whitecats
    OP
    Apr 18, 2024
    3
    @ElmerZhang 感谢
    cubecube
    cubecube
    Apr 18, 2024
    4
    mysql 也支持分区表了,直接分区吧。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   917 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 20:32 · PVG 04:32 · LAX 12:32 · JFK 15:32
    ♥ Do have faith in what you're doing.