MYSQL LIMIT 效能測試

2022-08-29 05:09:11 字數 848 閱讀 6166

# 普通表

select * from test_page limit m,n

# 記憶體表

select * from test_page_memory limit m,n

查詢位置(offset,size)

普通表(查詢時間)

記憶體表(查詢時間)

100,100

0.004s

0.001s

1000,100

0.004s

0.001s

10000,100

0.007s

0.001s

100000,100

0.031s

0.007s

200000,100

0.06s

0.016s

300000,100

0.084s

0.02s

400000,100

0.112s

0.026s

500000,100

0.138s

0.031s

600000,100

0.166s

0.037s

700000,100

0.19s

0.044s

800000,100

0.218s

0.051s

900000,100

0.243s

0.055s

1000000,100

0.27s

0.059s

總的來說,在百萬級資料情況下,使用 limit 速度還是可以接受的。

記憶體錶比普通表效能提公升 3-5 倍左右。

MySQL limit 效能分析

limit用法 mysql的分頁查詢語句的效能分析 對於有大資料量的mysql表來說,使用limit分頁存在很嚴重的效能問題。有彩蛋哦 在我們使用查詢語句的時候,經常要返回前幾條或者中間某幾行資料,這個時候怎麼辦呢?不用擔心,mysql已經為我們提供了這樣乙個功能。select from table...

mysql limit效能問題

我們通常使用limit進行分頁查詢 select from table name where val 4 order by id limit 100,10 當偏移量很大時,會遇到效能問題 select from table name where val 4 order by id limit 100...

mysql limit 效能優化 有感

基礎用法 limit 的用法是limit offset rows 其中 offset 表示偏移值,rows 表示需要返回的資料行。mysql 的 limit 給分頁帶來了極大的方便,但資料偏移量一大,limit 的效能就急劇下降。以下是兩條查詢語句,都是取10條資料,但效能就相去甚遠。select ...