<legend id='14jAA'><style id='14jAA'><dir id='14jAA'><q id='14jAA'></q></dir></style></legend>

    <tfoot id='14jAA'></tfoot>

        <small id='14jAA'></small><noframes id='14jAA'>

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

        在 MySQL 中删除表也会删除索引吗?

        Does dropping a table in MySQL also drop the indexes?(在 MySQL 中删除表也会删除索引吗?)
          <tbody id='8LsW2'></tbody>
          <bdo id='8LsW2'></bdo><ul id='8LsW2'></ul>
            1. <tfoot id='8LsW2'></tfoot>

                  <legend id='8LsW2'><style id='8LsW2'><dir id='8LsW2'><q id='8LsW2'></q></dir></style></legend>

                  <small id='8LsW2'></small><noframes id='8LsW2'>

                  <i id='8LsW2'><tr id='8LsW2'><dt id='8LsW2'><q id='8LsW2'><span id='8LsW2'><b id='8LsW2'><form id='8LsW2'><ins id='8LsW2'></ins><ul id='8LsW2'></ul><sub id='8LsW2'></sub></form><legend id='8LsW2'></legend><bdo id='8LsW2'><pre id='8LsW2'><center id='8LsW2'></center></pre></bdo></b><th id='8LsW2'></th></span></q></dt></tr></i><div id='8LsW2'><tfoot id='8LsW2'></tfoot><dl id='8LsW2'><fieldset id='8LsW2'></fieldset></dl></div>
                1. 本文介绍了在 MySQL 中删除表也会删除索引吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  文档中没有明确提及(http://dev.mysql.com/doc/refman/6.0/en/drop-table.html).我问是因为我刚刚在 Rails 项目中看到一个奇怪的数据库迁移,其中开发人员在删除表之前删除所有索引,这似乎没有必要.

                  It's not explicitly mentioned in the documentation (http://dev.mysql.com/doc/refman/6.0/en/drop-table.html). I ask because I just saw a curious database migration in a Rails project where the developer was removing all the indexes before dropping the table, and that seemed unnecessary.

                  推荐答案

                  是的,确实如此.

                  但是,如果您有外键约束(例如 RESTRICT)来确保与其他表的参照完整性,则您需要在删除或截断表之前删除这些键.

                  However, if you have foreign key constraints such as RESTRICT that ensure referential integrity with other tables, you'll want to drop those keys prior to dropping or truncating a table.

                  这篇关于在 MySQL 中删除表也会删除索引吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  ibtmp1是非压缩的innodb临时表的独立表空间,通过innodb_temp_data_file_path参数指定文件的路径,文件名和大小,默认配置为ibtmp1:12M:autoextend,也就是说在文件系统磁盘足够的情况下,这个文件大小是可以无限增长的。 为了避免ibtmp1文件无止境的暴涨导致
                  What does SQL clause quot;GROUP BY 1quot; mean?(SQL 子句“GROUP BY 1是什么意思?意思是?)
                  MySQL groupwise MAX() returns unexpected results(MySQL groupwise MAX() 返回意外结果)
                  MySQL SELECT most frequent by group(MySQL SELECT 按组最频繁)
                  Why Mysql#39;s Group By and Oracle#39;s Group by behaviours are different(为什么 Mysql 的 Group By 和 Oracle 的 Group by 行为不同)
                  MySQL GROUP BY DateTime +/- 3 seconds(MySQL GROUP BY DateTime +/- 3 秒)

                  • <bdo id='oWVRL'></bdo><ul id='oWVRL'></ul>
                      <tbody id='oWVRL'></tbody>
                    • <small id='oWVRL'></small><noframes id='oWVRL'>

                        <tfoot id='oWVRL'></tfoot>

                      1. <legend id='oWVRL'><style id='oWVRL'><dir id='oWVRL'><q id='oWVRL'></q></dir></style></legend>

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