简体   繁体   English

MyISAM Vs InnoDB MySQL引擎上的选择查询结果的差异(特别是对于全文本搜索)

[英]Difference in select query result on MyISAM Vs InnoDB MySQL engines(especially for FULL TEXT SEARCHES)

I would like to know if there is any difference in the result output of the same select query on MyISAM Vs that on InnoDB for the same table. 我想知道在同一个表的InnoDB上MyISAM V上的相同选择查询的结果输出是否有任何差异。

The thing I am aware of is MyISAM can do FULL TEXT searches. 我所知道的是MyISAM可以进行全文搜索。 But will the order of the output differ ? 但输出的顺序会有所不同吗?

The ordering of the output is determined by the order by clause. 输出的order by子句确定。 You have three possibilities. 你有三种可能性。

First, there is no order by clause. 首先,没有order by子句。 Then the result set is in an indeterminate order. 然后结果集处于不确定的顺序。 You cannot say that running the same query on the same data will produce results in the same order on multiple runs. 您不能说对同一数据运行相同的查询将在多次运行中以相同的顺序生成结果。 You definitely cannot make any statement about runs on different databases. 你肯定无法对不同数据库上的运行做出任何声明。

Second, there is an order by clause and it is a stable sort -- meaning that each key for the order by uniquely identifies each row (there are no ties). 其次,有一个order by子句,它是一个稳定的排序 - 意味着订单的每个键通过唯一标识每一行(没有关系)。 Then the results are specified by both the SQL standard and MySQL documentation. 然后结果由SQL标准和MySQL文档指定。 The result sets will be in the same order. 结果集的顺序相同。

Third, there is an order by clause and there are ties. 第三,有一个order by子句,并且有联系。 The keys will be in the same order in both result sets. 两个结果集中的键的顺序相同。 However, because keys with ties can be in any order, the two result sets are not guaranteed to be in the same order. 但是,由于具有关系的键可以按任何顺序排列,因此不保证两个结果集的顺序相同。

Summary: if you want results in a particular order, use order by . 摘要:如果您想要特定订单的结果,请使用order by

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM