日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > 数据库 >内容正文

数据库

MySQL排序缓冲区溢出([HY001]; error code [1038],Out of sort memory, consider increasing server sort buffer )

發布時間:2023/12/18 数据库 37 豆豆
生活随笔 收集整理的這篇文章主要介紹了 MySQL排序缓冲区溢出([HY001]; error code [1038],Out of sort memory, consider increasing server sort buffer ) 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

背景

線上服務某些條件下的列表查詢失敗,報系統異常,查詢線上日志發現報了排序緩沖區溢出

### Cause: java.sql.SQLException: Out of sort memory, consider increasing server sort buffer size
; uncategorized SQLException; SQL state [HY001]; error code [1038]; Out of sort memory, consider increasing server sort buffer size; nested exception is java.sql.SQLException: Out of sort memory, consider increasing server sort buffer size

資料查找

mysql - Error "1038 Out of sort memory, consider increasing sort buffer size - Stack Overflowhttps://stackoverflow.com/questions/29575835/error-1038-out-of-sort-memory-consider-increasing-sort-buffer-size根據2021-04-26 12點19分Webnet的回答,即使只使用主鍵排序,但是select字段中含有超長字段就可能會觸發這個問題,我們線上的SQL就是只使用了主鍵排序,但是select字段中有個超長的text字段

根據該回答提及的MySQL問題鏈接,查看bug記錄

MySQL Bugs: #103225: "Out of sort memory error" has an inconsistent relationship with the buffer sizehttps://bugs.mysql.com/bug.php?id=103225可知道MySQL版本大于8.0.17且小于8.0.28的會存在此問題,此問題在8.0.28版本已修復,而我服務器MySQL的版本為8.0.25,根據bug評論,在問題版本區間內有兩種解決方案

1.在配置文件中配置sort_buffer_size,但是都不建議,因為這治標不治本,而且也不好估計設置多少合適

2.將大字段類型改為longtext,這樣可以走8.0.17版本的處理邏輯,就不會觸發這個bug

總結

以上是生活随笔為你收集整理的MySQL排序缓冲区溢出([HY001]; error code [1038],Out of sort memory, consider increasing server sort buffer )的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。