MySQL??????????
???????????? ???????[ 2015/3/9 15:24:36 ] ????????????? ??????? MySQL
??????????????????????????MySQL?????????????????????????????????????Щ????SQL?????????Σ???????????????MySQL?????б?д?????Ч??SQL??
????1???????????????
????????????????£?
????ANALYZE[LOCAL|NO_WRITE_TO_BINLOG]TABLE tb1_name[??tbl_name]...
????????????????????洢????????????????????????????????????????????????SQL??????????????м???????????о??????м??????????????м?????????η?????????????????????????????????????????????????????MyISAM??DBD??InnoDB???????á?
???????????????????
????analyze table table_name
??????????????£?
????CHECK TABLE tb1_name[??tbl_name]...[option]...option={QUICK|FAST|MEDIUM|EXTENDED|CHANGED}
??????????????????????????????д???CHECK TABLE??MyISAM??InnoDB?????????????MyISAM????????????????????
????CHECK TABLE??????????????д?????????????????б?????????????
????2.?????????
???????????????£?
????OPTIMIZE[LOCAL|NO_WRITE_TO_BINLOG]TABLE tb1_name[??tbl_name]...
??????????????????????????????????п?????е??(????VARCHAR??BLOB??TEXT?е??)???и?????????????OPTIMIZE TABLE?????????б????????????????????е?????????к?????????????????????????????????????????OPTIMIZE TABLE???????MyISAM??BDB??InnoDB???????á?
???????磺optimize table table_name
???????analyze??check??optimize?????佫????????????????????????MySQL?????????????????????????
?????????SQL???
?????????????????????????SQL????????INSERT??GROUPBY??????????ЩSQL???????????????????
????1.??????????????
????????load?????????????????????????????????????
????????MyISAM?洢?????????????????·???????????????????
????????????:
????ALTER TABLE tb1_name DISABLE KEYS;
????loading the data
????ALTER TABLE tb1_name ENABLE KEYS;
????DISABLE KEYS??ENABLE KEYS????????????MyISAM???????????????????????????????????MyISAM?????????????????????????????????Ч???
???????????????????????????MyISAM????????????????????????????????????????y??????á?
????load data infile'/home/mysql/text_txt'into table text
????????InnoDB????????????????????????????Ч???????м??????InnoDB??????????????????
????1.???InnoDB????????????????????????????????????????????????????????????Ч???????????Ч???
????2.?????????????SET UNIQUE_CHECKS=0???????У?飬?????????????SET UNIQUE_CHECKS=1???????У?飬???????????Ч???
????3.?????????????????????????????????SET AUTOCOMMIT=0????????????????????????SET AUTOCOMMIT=1??????????????????????Ч???
???????INSERT???
??????????????INSERT???????????????????????????????
????1.????????????????????У??????????????INSERT????????????????????????MySQL???????????????????????Ч???????е????INSERT????.
???????磺
????insert into test values(1??2)
????insert into test values(3??4)
????insert into test values(5??6)
????????????????:insert into test values(1??2)??(3??4)??(5??6)……
????2.?????????????????У?????????INSERT DELAYED??????????????
????DELAYED?????????INSERT?????????У???????????????????????У??????????д?????????????????????????LOW_PRIORITY?????????????????????????д??????в???
????3.?????????????????????????????????
????4.???????????????????????bulk_insert_buffer_size????????????????????????????????MyISAM????á?
????5.?????????????????????????????LOAD DATA INFILE???????????ú??insert????20???????
??????????MySQL??????????Щ????????????????????????????mysql???????
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11