97久久国产亚洲精品超碰热,成人又色又爽的免费网站,色偷偷女人的天堂a,男女高潮喷水在线观看,国内精品一线二线三线区别在哪里

返回列表 發(fā)帖
查看: 1564|回復(fù): 3

[求助] 頁(yè)面底部的查詢(xún)時(shí)間變長(zhǎng)了要如何優(yōu)化?另外看了下慢查詢(xún)記錄里有個(gè)表請(qǐng)求時(shí)間很久是缺少索引嗎?

5

主題

132

回帖

245

積分

爐火純青

貢獻(xiàn)
3 點(diǎn)
金幣
67 個(gè)
樓主
發(fā)表于 2023-12-11 19:12:56 | 只看樓主 |只看大圖 |倒序?yàn)g覽 |閱讀模式
比如Dismall網(wǎng)站底部的處理時(shí)間是0.03秒左右,我們之前最快也差不多,現(xiàn)在變成了0.07秒左右,不知道是哪里設(shè)置沒(méi)優(yōu)化好還是數(shù)據(jù)庫(kù)問(wèn)題,已經(jīng)啟用Redis



另外慢查詢(xún)里發(fā)現(xiàn)兩個(gè)表的時(shí)間比較久,表是innodb引擎,請(qǐng)問(wèn)是那里問(wèn)題?
  1. # Time: 2023-12-11T10:52:54.556741Z
  2. # User@Host: root[root] @ localhost [127.0.0.1]  Id: 364698
  3. # Query_time: 4.171622  Lock_time: 0.000000 Rows_sent: 6  Rows_examined: 629667
  4. SET timestamp=1702291974;
  5. SELECT DISTINCT t.*, ti.attachment as attachmenturl, ti.remote
  6.                         FROM `pre_forum_thread` t
  7.                          INNER JOIN `pre_forum_threadimage` ti ON t.tid=ti.tid WHERE t.readperm='0'
  8.                          AND t.fid IN ('37','36','2') AND t.isgroup='0'
  9.                         AND t.displayorder>='0'
  10.                         ORDER BY t.dateline DESC
  11.                         LIMIT 0,6;
  12. # Time: 2023-12-11T10:52:55.744347Z
  13. # User@Host: root[root] @ localhost [127.0.0.1]  Id: 364782
  14. # Query_time: 1.078406  Lock_time: 0.000000 Rows_sent: 6  Rows_examined: 156282
  15. SET timestamp=1702291975;
  16. SELECT DISTINCT t.*, ti.attachment as attachmenturl, ti.remote
  17.                         FROM `pre_forum_thread` t
  18.                          INNER JOIN `pre_forum_threadimage` ti ON t.tid=ti.tid WHERE t.readperm='0'
  19.                          AND t.fid IN ('37') AND t.isgroup='0'
  20.                         AND t.displayorder>='0'
  21.                         ORDER BY t.dateline DESC
  22.                         LIMIT 0,6;
  23. # Time: 2023-12-11T10:54:16.983359Z
  24. # User@Host: root[root] @ localhost [127.0.0.1]  Id: 366522
  25. # Query_time: 1.254606  Lock_time: 0.000000 Rows_sent: 10  Rows_examined: 397061
  26. SET timestamp=1702292056;
  27. SELECT DISTINCT t.*
  28.                         FROM `pre_forum_thread` t
  29.                          WHERE t.readperm='0'
  30.                          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'
  31.                         AND t.displayorder>='0'
  32.                         ORDER BY t.dateline DESC
  33.                         LIMIT 0,10;
  34. # Time: 2023-12-11T10:54:18.474966Z
  35. # User@Host: root[root] @ localhost [127.0.0.1]  Id: 366548
  36. # Query_time: 1.226406  Lock_time: 0.000000 Rows_sent: 10  Rows_examined: 397061
  37. SET timestamp=1702292058;
  38. SELECT DISTINCT t.*
  39.                         FROM `pre_forum_thread` t
  40.                          WHERE t.readperm='0'
  41.                          AND t.fid IN ('37','36','2') AND t.special IN ('0') AND t.isgroup='0'
  42.                         AND t.displayorder>='0'
  43.                         ORDER BY t.dateline DESC
  44.                         LIMIT 0,10;
  45. # Time: 2023-12-11T10:56:56.033320Z
  46. # User@Host: root[root] @ localhost [127.0.0.1]  Id: 369432
  47. # Query_time: 1.996411  Lock_time: 0.001000 Rows_sent: 3  Rows_examined: 397108
  48. SET timestamp=1702292216;
  49. SELECT DISTINCT t.*, ti.attachment as attachmenturl, ti.remote
  50.                         FROM `pre_forum_thread` t
  51.                          INNER JOIN `pre_forum_threadimage` ti ON t.tid=ti.tid WHERE t.readperm='0'
  52.                          AND t.fid IN ('48') AND t.isgroup='0' AND t.dateline >= '1701687413'
  53.                         AND t.displayorder>='0'
  54.                         ORDER BY t.recommends DESC
  55.                         LIMIT 0,3;
  56. # Time: 2023-12-11T10:57:06.324541Z
  57. # User@Host: root[root] @ localhost [127.0.0.1]  Id: 369624
  58. # Query_time: 2.121604  Lock_time: 0.000000 Rows_sent: 3  Rows_examined: 397222
  59. SET timestamp=1702292226;
  60. SELECT DISTINCT t.*, ti.attachment as attachmenturl, ti.remote
  61.                         FROM `pre_forum_thread` t
  62.                          INNER JOIN `pre_forum_threadimage` ti ON t.tid=ti.tid WHERE t.readperm='0'
  63.                          AND t.fid IN ('51','52','88') AND t.isgroup='0' AND t.dateline >= '1701687424'
  64.                         AND t.displayorder>='0'
  65.                         ORDER BY t.recommends DESC
  66.                         LIMIT 0,3;
復(fù)制代碼



我知道答案 回答被采納將會(huì)獲得1 貢獻(xiàn) 已有3人回答

14

主題

3455

回帖

5880

積分

應(yīng)用開(kāi)發(fā)者

貢獻(xiàn)
409 點(diǎn)
金幣
172 個(gè)
QQ
沙發(fā)
發(fā)表于 2023-12-11 20:09:56 | 只看Ta
0.07 已經(jīng)很快了!不影響正常訪(fǎng)問(wèn)!  沒(méi)必要費(fèi)七八力的再去做優(yōu)化!
緩存 也要有訪(fǎng)問(wèn)過(guò) 才有作用! 隨著數(shù)據(jù)庫(kù)的增大, 硬盤(pán)io的壓力增大, 速度肯定會(huì)越來(lái)越慢的!

5

主題

132

回帖

245

積分

爐火純青

貢獻(xiàn)
3 點(diǎn)
金幣
67 個(gè)
板凳
 樓主| 發(fā)表于 2023-12-11 20:19:19 | 只看Ta
天外飄仙 發(fā)表于 2023-12-11 20:09
0.07 已經(jīng)很快了!不影響正常訪(fǎng)問(wèn)!  沒(méi)必要費(fèi)七八力的再去做優(yōu)化!
緩存 也要有訪(fǎng)問(wèn)過(guò) 才有作用! 隨著數(shù)據(jù)庫(kù) ...

因之前也是0.03秒左右,過(guò)幾天就增加了,所以想知道是哪里問(wèn)題,跟哪些設(shè)置有關(guān)系

14

主題

3455

回帖

5880

積分

應(yīng)用開(kāi)發(fā)者

貢獻(xiàn)
409 點(diǎn)
金幣
172 個(gè)
QQ
地板
發(fā)表于 2023-12-11 20:42:18 | 只看Ta
數(shù)碼達(dá)人 發(fā)表于 2023-12-11 20:19
因之前也是0.03秒左右,過(guò)幾天就增加了,所以想知道是哪里問(wèn)題,跟哪些設(shè)置有關(guān)系 ...

你多刷新幾次看看呢!
除非慢查詢(xún) 頻繁出現(xiàn), 偶爾出現(xiàn)是正常的! cpu爆表的時(shí)候  很容易出現(xiàn)慢查詢(xún)! 隨著訪(fǎng)問(wèn)量的增大, cpu和硬盤(pán)io的 可用性能肯定會(huì)越來(lái)越少!

dz的sql優(yōu)化 已經(jīng)非常好了!  我 50G的數(shù)據(jù)庫(kù) ssd硬盤(pán) 沒(méi)啥壓力! 如果機(jī)械硬盤(pán)肯定就不行了! 機(jī)械硬盤(pán)io不行

本版積分規(guī)則

  • 關(guān)注公眾號(hào)
  • 有償服務(wù)微信
  • 有償服務(wù)QQ

手機(jī)版|小黑屋|Discuz! 官方交流社區(qū) ( 皖I(lǐng)CP備16010102號(hào) |皖公網(wǎng)安備34010302002376號(hào) )|網(wǎng)站地圖|star

GMT+8, 2025-10-16 14:43 , Processed in 0.058141 second(s), 13 queries , Redis On.

Powered by Discuz! X5.0 Licensed

© 2001-2025 Discuz! Team.

關(guān)燈 在本版發(fā)帖
有償服務(wù)QQ
有償服務(wù)微信
返回頂部
快速回復(fù) 返回頂部 返回列表