- 積分
- 243
- 金幣
- 67 個(gè)
- 社區(qū)幣
- 0 元
爐火純青
- 貢獻(xiàn)
- 3 點(diǎn)
- 金幣
- 67 個(gè)
|
比如Dismall網(wǎng)站底部的處理時(shí)間是0.03秒左右,我們之前最快也差不多,現(xiàn)在變成了0.07秒左右,不知道是哪里設(shè)置沒優(yōu)化好還是數(shù)據(jù)庫問題,已經(jīng)啟用Redis
5XSKCezPJ6.jpg (4.12 KB, 下載次數(shù): 6)
下載附件
2023-12-11 19:10 上傳
另外慢查詢里發(fā)現(xiàn)兩個(gè)表的時(shí)間比較久,表是innodb引擎,請問是那里問題?
- # Time: 2023-12-11T10:52:54.556741Z
- # User@Host: root[root] @ localhost [127.0.0.1] Id: 364698
- # Query_time: 4.171622 Lock_time: 0.000000 Rows_sent: 6 Rows_examined: 629667
- SET timestamp=1702291974;
- SELECT DISTINCT t.*, ti.attachment as attachmenturl, ti.remote
- FROM `pre_forum_thread` t
- INNER JOIN `pre_forum_threadimage` ti ON t.tid=ti.tid WHERE t.readperm='0'
- AND t.fid IN ('37','36','2') AND t.isgroup='0'
- AND t.displayorder>='0'
- ORDER BY t.dateline DESC
- LIMIT 0,6;
- # Time: 2023-12-11T10:52:55.744347Z
- # User@Host: root[root] @ localhost [127.0.0.1] Id: 364782
- # Query_time: 1.078406 Lock_time: 0.000000 Rows_sent: 6 Rows_examined: 156282
- SET timestamp=1702291975;
- SELECT DISTINCT t.*, ti.attachment as attachmenturl, ti.remote
- FROM `pre_forum_thread` t
- INNER JOIN `pre_forum_threadimage` ti ON t.tid=ti.tid WHERE t.readperm='0'
- AND t.fid IN ('37') AND t.isgroup='0'
- AND t.displayorder>='0'
- ORDER BY t.dateline DESC
- LIMIT 0,6;
- # Time: 2023-12-11T10:54:16.983359Z
- # User@Host: root[root] @ localhost [127.0.0.1] Id: 366522
- # Query_time: 1.254606 Lock_time: 0.000000 Rows_sent: 10 Rows_examined: 397061
- SET timestamp=1702292056;
- SELECT DISTINCT t.*
- FROM `pre_forum_thread` t
- WHERE t.readperm='0'
- AND t.fid IN ('82','40','41','44','43','45','63','39','87','64','51','52','88','56','48','57','59','61','60','66','67','68','70','71','72','74','76','93','79') AND t.isgroup='0'
- AND t.displayorder>='0'
- ORDER BY t.dateline DESC
- LIMIT 0,10;
- # Time: 2023-12-11T10:54:18.474966Z
- # User@Host: root[root] @ localhost [127.0.0.1] Id: 366548
- # Query_time: 1.226406 Lock_time: 0.000000 Rows_sent: 10 Rows_examined: 397061
- SET timestamp=1702292058;
- SELECT DISTINCT t.*
- FROM `pre_forum_thread` t
- WHERE t.readperm='0'
- AND t.fid IN ('37','36','2') AND t.special IN ('0') AND t.isgroup='0'
- AND t.displayorder>='0'
- ORDER BY t.dateline DESC
- LIMIT 0,10;
- # Time: 2023-12-11T10:56:56.033320Z
- # User@Host: root[root] @ localhost [127.0.0.1] Id: 369432
- # Query_time: 1.996411 Lock_time: 0.001000 Rows_sent: 3 Rows_examined: 397108
- SET timestamp=1702292216;
- SELECT DISTINCT t.*, ti.attachment as attachmenturl, ti.remote
- FROM `pre_forum_thread` t
- INNER JOIN `pre_forum_threadimage` ti ON t.tid=ti.tid WHERE t.readperm='0'
- AND t.fid IN ('48') AND t.isgroup='0' AND t.dateline >= '1701687413'
- AND t.displayorder>='0'
- ORDER BY t.recommends DESC
- LIMIT 0,3;
- # Time: 2023-12-11T10:57:06.324541Z
- # User@Host: root[root] @ localhost [127.0.0.1] Id: 369624
- # Query_time: 2.121604 Lock_time: 0.000000 Rows_sent: 3 Rows_examined: 397222
- SET timestamp=1702292226;
- SELECT DISTINCT t.*, ti.attachment as attachmenturl, ti.remote
- FROM `pre_forum_thread` t
- INNER JOIN `pre_forum_threadimage` ti ON t.tid=ti.tid WHERE t.readperm='0'
- AND t.fid IN ('51','52','88') AND t.isgroup='0' AND t.dateline >= '1701687424'
- AND t.displayorder>='0'
- ORDER BY t.recommends DESC
- LIMIT 0,3;
復(fù)制代碼
我知道答案
回答被采納將會(huì)獲得 1 貢獻(xiàn) 已有3人回答
|
|