mysql notes

How to query what engine your database supports

SHOW ENGINES

 

You can specify the database engine when creating a table

ENGINE=MyISAM : specify the engine

CHARSET=UTF-8 : specify encoding

 

Features of various storage engines:

MyISAM: Storage Limits: Yes,

Lock mechanism: table lock,

Index: B-tree, full text

Cache: Support index cache

Data compressible: support

Space usage: low

Memory usage: low

Bulk Insert Speed: High

 

InnoDB: Storage Limit: 64TB

           Transaction: Support

           Locking mechanism: row lock

           Index: B-tree index, cluster index

           Cache: support data cache, support index cache

           Space usage: high

           Memory usage: high

     Bulk Insert Speed: Low

      Support foreign keys

 

 

 

Application scenarios

MyISAM does not support transactions, nor does it support foreign keys, the advantage is that the access speed is fast. Applications that do not require transaction integrity or select and insert-based applications can basically use this engine to create tables

 

 

 

 

 

 

 

choice of data type

The difference between Text and bolb:

text can only store text types, bolb can store binary types

Performance issues caused by Text and bolb:

When deleting, it will leave a lot of holes. It is recommended to use optimize regularly for defragmentation. The syntax is as follows:

OPTIMIZE TABLE table name; : defragmentation

How to provide an efficient query plan in a table with text and bolb

1. Hash value index (synthetic index)

2. Store the columns of text and bolb into a separate table

3. If it is not necessary, try to retrieve the value of text and bolb as little as possible, such as select *

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325801142&siteId=291194637
Recommended