為什麼選innodb

2021-09-10 02:21:47 字數 900 閱讀 2784

1.檢視當前資料引擎的命令:

show engines;

2.use `

[dbname]`;

select group_concat(concat( 'alter table ' ,table_name ,' engine=innodb; ') separator '' )

from information_schema.tables as t

where table_schema = '

[dbname]

' and table_type = 'base table';

將其中的紅色部分替換為你所使用的資料庫

執行後其實生成的是查詢命令,然後copy生產的命令,執行sql 即可:

alter table info_aaaa engine=innodb; alter table info_data_bbb engine=innodb; alter table info_data_ccc engine=innodb; alter table info_data_ddd engine=innodb; alter table info_data_eee engine=innodb; alter table info_data_fffengine=innodb;

再次檢視資料表的資料引擎已經更改了:show table status from [dbname];

innodb       事務,安全,可恢復性快。  行鎖。

myisam     

全文索引,速度快。   只支援表鎖。

alter table table_name engine=myisam;  

posted @

2017-11-11 14:54

newman·li 閱讀(

...)

編輯收藏

MyISAM查詢速度為什麼比InnoDB快

innodb mylsam兩者引擎所用的索引的資料結構都是b 樹,不過區別在於 mylsam中的b 樹的資料結構儲存的內容是實際資料的位址值,它的索引和實際資料是分開的,只不過使用索引指向實際資料,這種索引的模式被成為非聚集索引。innodb中b 樹的資料結構儲存的都是實際的資料,這種索引稱為聚集索...

為什麼MyISAM會比Innodb的查詢速度快

innodb在做select的時候,要維護的東西比myisam引擎多很多 1 資料塊,innodb要快取,myisam只快取索引塊,這中間還有換進換出的減少 2 innodb定址要對映到塊,再到行,myisam記錄的直接是檔案的offset,定位比innodb要快 3 innodb還需要維護mvcc...

為什麼要選GPU雲主機

如果在10年前說起雲計算,相信大部分人的反應是 不知所云 隨著近幾年雲計算應用場景的普及,資料上雲的概念已逐漸深入人心。伴隨著業務場景的日益複雜化,對大量資料進行高效處理的需求越來越強烈,計算體系架構從單一依賴cpu的計算單元的應用擴充套件到多種體系架構,於是對gpu,fpga等專業計算晶元也提出了...