-3

I'm pretty confused about what makes searches fast and what slow. Does it search faster a 50 chars long text than 100, among 1 million rows?.... or how does it effects in case of a string or for an integer search?

4

1 回答 1

1

搜索在整数上最快,在长文本上最慢。就如此容易。如果您的数据包含长文本列,您还可以在该列上创建包含有限字符的索引。

同样,对于较短的文本,搜索会比较长的文本更快。

如果您广泛使用文本列并且必须在巨大的文本字段之间进行搜索,最好选择全文搜索(从 MySQL 5.6 开始也可以在 InnoDB 中使用)。

如果你的读多于写,并且不需要参照完整性和事务,你可以使用足够快的 MyISAM(连同全文搜索)。

于 2013-09-20T04:51:21.003 回答