已采納回答 / Kollen
簡單解釋,組合索引index(a,b) 會創建基于a,ab創建兩個索引。你想一下創建索引的原則是什么?如果某列的離散度很低,一個表有100w行數據,該列只有兩種不同的值,你會在該列上創建索引嗎? 所以就明白了,如果a的離散度很低,在a上創建索引和前面分析的原則是不是矛盾了??偨Y,就是要降低掃描索引的消耗,為什么離散度高了可以降低,這是btree的結構問題
2016-07-31
已采納回答 / 慕俠3252176
這個可不一定啊,如果只有一個字段的索引,比如:key(city_code),使用的查詢就是select city_code from tab where ...的話,這個就可以說是覆蓋索引了,但是并不是聯合索引啊
2016-06-07
已采納回答 / 7751
set global 只是全局session生效,重啟后失效,如果需要以上配置永久生效,需要在mysql.ini(linux mysql.cnf)中配置[mysqld]slow_query_log ?= 1log_queries_not_using_indexes = 1long_query_time = 0.1slow_query_log_file = c:\mysql\log\mysqlslowquery.log
2016-04-21
已采納回答 / 大老唐
0和2都是每秒從緩沖區寫入文件一次。區別是commit操作時,0不做任何操作,為2 的時候,commit時會把緩沖區內容寫入文件。文檔上是這么寫的:If the value of innodb_flush_log_at_trx_commit is 0, the log buffer is written out to the log file once per second and the flush to disk operation is performed on the log file, but ...
2016-02-20