<small id='gSjKs'></small><noframes id='gSjKs'>

      • <bdo id='gSjKs'></bdo><ul id='gSjKs'></ul>
    1. <i id='gSjKs'><tr id='gSjKs'><dt id='gSjKs'><q id='gSjKs'><span id='gSjKs'><b id='gSjKs'><form id='gSjKs'><ins id='gSjKs'></ins><ul id='gSjKs'></ul><sub id='gSjKs'></sub></form><legend id='gSjKs'></legend><bdo id='gSjKs'><pre id='gSjKs'><center id='gSjKs'></center></pre></bdo></b><th id='gSjKs'></th></span></q></dt></tr></i><div id='gSjKs'><tfoot id='gSjKs'></tfoot><dl id='gSjKs'><fieldset id='gSjKs'></fieldset></dl></div>
      <legend id='gSjKs'><style id='gSjKs'><dir id='gSjKs'><q id='gSjKs'></q></dir></style></legend>
        <tfoot id='gSjKs'></tfoot>

      1. Mysql - 归档数据,使用哪种解决方案?

        时间:2023-08-21

        <small id='R5nwt'></small><noframes id='R5nwt'>

        <tfoot id='R5nwt'></tfoot>
        • <i id='R5nwt'><tr id='R5nwt'><dt id='R5nwt'><q id='R5nwt'><span id='R5nwt'><b id='R5nwt'><form id='R5nwt'><ins id='R5nwt'></ins><ul id='R5nwt'></ul><sub id='R5nwt'></sub></form><legend id='R5nwt'></legend><bdo id='R5nwt'><pre id='R5nwt'><center id='R5nwt'></center></pre></bdo></b><th id='R5nwt'></th></span></q></dt></tr></i><div id='R5nwt'><tfoot id='R5nwt'></tfoot><dl id='R5nwt'><fieldset id='R5nwt'></fieldset></dl></div>

              • <bdo id='R5nwt'></bdo><ul id='R5nwt'></ul>

                  <legend id='R5nwt'><style id='R5nwt'><dir id='R5nwt'><q id='R5nwt'></q></dir></style></legend>
                    <tbody id='R5nwt'></tbody>
                  本文介绍了Mysql - 归档数据,使用哪种解决方案?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我使用的是 MySQL 5.x,有一个主表包含所有客户的统计数据.我想对其运行报告,但不想在同一张表上运行它,所以我想每天晚上将数据移动到仅用于报告的不同表中.我的问题是,为每个客户也有一个单独的表进行存档,还是只为所有客户创建一个存档表是有益的吗?系统中可能有数以千计的客户,如果我决定按客户将其分解,则可能意味着数以千计的存档表.你的想法?

                  I am using MySQL 5.x and there is one main table that has the stats combined for all customers. I would like to run reporting on it but dont want to run it on the same table so Im thinking of every night moving the data to a different table that will only be used for reporting. My question is would it be beneficial to have a seperate table for each customer to archive too or just have it just one archive table for all customers? There could be thousands of customers in the system which could mean thousands of archive tables if I decide to break it up by customer. Your thoughts?

                  推荐答案

                  如果您为每个客户使用个人,则表的数量会增加.

                  If you use the individual for each customer, tables will grow in number.

                  如果你有统计数据,那么我建议像下面这样总结

                  If you have statistics data then i suggest to summarize it like below

                  1. 将过去 1 个月的数据保存在同一个主表中.
                  2. maintable_quartely 表中的季度数据/半年数据,根据报告要求保存平均或汇总数据
                  3. maintable_archieve 中的旧数据,其中包含 > 根据报告要求平均或汇总的每季度或半年数据

                  如果你想把整个事情放在一起,你需要组合三个表.

                  If you want the whole thing together you need to combine three tables.

                  另一种方式,使用mysql复制和master进行insert、update、delete和slave进行select

                  other way, use mysql replication and master for insert,update,delete and slave for select

                  这篇关于Mysql - 归档数据,使用哪种解决方案?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:SQL Server 复制 下一篇:Archlinux mysqld 无法启动

                  相关文章

                  最新文章

                • <small id='mv4y4'></small><noframes id='mv4y4'>

                  1. <i id='mv4y4'><tr id='mv4y4'><dt id='mv4y4'><q id='mv4y4'><span id='mv4y4'><b id='mv4y4'><form id='mv4y4'><ins id='mv4y4'></ins><ul id='mv4y4'></ul><sub id='mv4y4'></sub></form><legend id='mv4y4'></legend><bdo id='mv4y4'><pre id='mv4y4'><center id='mv4y4'></center></pre></bdo></b><th id='mv4y4'></th></span></q></dt></tr></i><div id='mv4y4'><tfoot id='mv4y4'></tfoot><dl id='mv4y4'><fieldset id='mv4y4'></fieldset></dl></div>
                    <tfoot id='mv4y4'></tfoot>

                    <legend id='mv4y4'><style id='mv4y4'><dir id='mv4y4'><q id='mv4y4'></q></dir></style></legend>

                        <bdo id='mv4y4'></bdo><ul id='mv4y4'></ul>