国产成人精品18p,天天干成人网,无码专区狠狠躁天天躁,美女脱精光隐私扒开免费观看

提升MySQL性能的方法有哪些

發(fā)布時(shí)間:2021-07-27 11:43 來(lái)源:億速云 閱讀:0 作者:chen 欄目: Mysql 歡迎投稿:712375056

這篇文章主要介紹“提升性能的方法有哪些”,在日常操作中,相信很多人在提升MySQL性能的方法有哪些問(wèn)題上存在疑惑,小編查閱了各式資料,整理出簡(jiǎn)單好用的操作方法,希望對大家解答”提升MySQL性能的方法有哪些”的疑惑有所幫助!接下來(lái),請跟著(zhù)小編一起來(lái)學(xué)習吧!

提升MySQL性能的幾個(gè)簡(jiǎn)易方法,主要用于設計、開(kāi)發(fā)階段的借鑒。[]1、Carefully choose attribute types and lengths.
仔細選擇字段的類(lèi)型與長(cháng)度。
2、Use fixed-length attributes: try to avoid the types VARCHAR, BLOB, and TEXT.
使用固定長(cháng)度的字段,盡量避免使用VARCHAR、BLOB、TEXT。
3、MySQL can't join tables using an index if the attributes are different types or (in some cases) have different lengths.
如果表的類(lèi)型或長(cháng)度不一致,MySQL在表連接時(shí)將無(wú)法使用索引。
4、Create a statistics table if aggregate functions such as COUNT( ) or SUM( ) are frequently used in queries that contain WHERE clauses and are on large tables.
對于包含where子句的查詢(xún)和大的表,如果經(jīng)常需要用到統計函數(如count、sum),最好創(chuàng )建對應的統計表。
5、If you're inserting large numbers of rows, list the values in one (or few) insert statements as this is much faster to process.
插入大量記錄的時(shí)候,僅在一個(gè)(或少數幾個(gè))insert語(yǔ)句中列出行的值,處理起來(lái)會(huì )快很多。(一個(gè)語(yǔ)句,多個(gè)行,行間用逗號分隔)
6、If large numbers of rows are deleted from a table, or a table containing variable-length attributes is frequently modified, disk space may be wasted.
一個(gè)表刪除大量記錄,或一個(gè)包含變長(cháng)字段的表頻繁修改,磁盤(pán)空間將被浪費。數據沒(méi)有被實(shí)際刪除或修改,僅僅對其位置標注不再使用而已。浪費的磁盤(pán)空間將影響訪(fǎng)問(wèn)速度。一般需要周期性地對表進(jìn)行重組優(yōu)化OPTIMIZE TABLE。
7、MySQL uses statistics about a table to make decisions about how to optimize each query. You can update these statistics by running:
ANALYZE TABLE customer;
MySQL使用一個(gè)表的統計數據來(lái)決定如何優(yōu)化每個(gè)查詢(xún)。更新表統計數據的命令:ANALYZE TABLE ...
8、Use the Heap table type discussed in "Table Types" for small tables that are searched only for exact matches using = or <=>.
使用HEAP類(lèi)型的表。

免責聲明:本站發(fā)布的內容(圖片、視頻和文字)以原創(chuàng )、來(lái)自本網(wǎng)站內容采集于網(wǎng)絡(luò )互聯(lián)網(wǎng)轉載等其它媒體和分享為主,內容觀(guān)點(diǎn)不代表本網(wǎng)站立場(chǎng),如侵犯了原作者的版權,請告知一經(jīng)查實(shí),將立刻刪除涉嫌侵權內容,聯(lián)系我們QQ:712375056,同時(shí)歡迎投稿傳遞力量。

一个人看的WWW片免费高清中文| 亚洲AV无码国产精品色软件下戴| 日韩午夜无码精品试看 | 曰本丰满熟妇XXXX性| 免费无码又黄又爽又刺激| А√在线中文网新版地址在线|