[20230103]COUNT STOPKEY operation.txt
[20230103]COUNT STOPKEY operation.txt
--//連結:http://blog.tanelpoder.com/2010/10/25/count-stopkey-operation-the-where-rownum/
--//rownum限制僅僅顯示2^32-1條,實際上12c版本已經修復了這個bug,透過例子驗證.
1.環境:
SCOTT@test01p> @ver1
PORT_STRING VERSION BANNER CON_ID
------------------------------ -------------- -------------------------------------------------------------------------------- ----------
IBMPC/WIN_NT64-9.1.0 12.2.0.1.0 Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production 0
2.測試:
with sq as (select null from dual connect by level <= 2000)
select count(*)
from sq a, sq b, sq c;
COUNT(*)
----------
8000000000
with sq as (select null from dual connect by level <= 2000)
select count(*)
from sq a, sq b, sq c
where rownum <= 8000000000;
COUNT(*)
----------
8000000000
--//11g下重複測試:
3.環境:
SCOTT@book> @ ver1
PORT_STRING VERSION BANNER
------------------------------ -------------- --------------------------------------------------------------------------------
x86_64/Linux 2.4.xx 11.2.0.4.0 Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
4.測試:
with sq as (select null from dual connect by level <= 2000)
select count(*)
from sq a, sq b, sq c;
COUNT(*)
----------
8000000000
with sq as (select null from dual connect by level <= 2000)
select count(*)
from sq a, sq b, sq c
where rownum <= 8000000000;
COUNT(*)
----------
4294967295
--//很明顯11.2.0.4存在這個bug.
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/267265/viewspace-2933490/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 關於COUNT STOPKEY的工作機制TopK
- SORT (UNIQUE STOPKEY)/ SORT GROUP BY STOPKEYTopK
- 使用索引優化StopKey索引優化TopK
- oracle 分頁優化(stopkey)Oracle優化TopK
- MySQL的COUNT語句--count(*)、 count(常量)、 count(列名)MySql
- count(0),count(1),count(*)總結與count(column)
- 【優化】COUNT(1)、COUNT(*)、COUNT(常量)、COUNT(主鍵)、COUNT(ROWID)等優化
- count(1),count(*),count(列)的區別
- count(*)、count(1)和count(列名)的區別
- count (*) 和 count (1) 和 count (列名) 區別
- count(*) 和 count(1)和count(列名)區別
- 圖解MySQL:count(*) 、count(1) 、count(主鍵欄位)、count(欄位)哪個效能最好?圖解MySql
- count(*) 和count(column)之區別
- [20180725]index skip-scan operation.txtIndex
- mysql中count(1)與count(*)比較MySql
- stopkey對索引掃描的影響測試TopK索引
- 【MySQL】效能優化之 count(*) VS count(col)MySql優化
- Ask Hoegh(4)——select count(*)和select count(1)、count(column)有區別嗎?
- MySQL:count(*) count(欄位) 實現上區別MySql
- SQL Server中count(*)和Count(1)的區別SQLServer
- count(*) 優化優化
- count(*)優化優化
- 理解exists count
- Count BFS Graph
- select count(*)和select count(1)的區別
- 7.36 BITMAP_COUNT
- count(*)小優化優化
- std::count 函式函式
- 解析Count函式函式
- 提高MSSQL資料庫效能(1)對比count(*) 和 替代count(*)SQL資料庫
- High Version Count Issues(SQL高Version Count) (文件 ID 296377.1)SQL
- C# 中List中的Count和Count(),有什麼區別C#
- 7.13 APPROX_COUNTAPP
- mysql count()的使用解析MySql
- MySQL Count(*)提速30倍MySql
- Leetcode Count and SayLeetCode
- LeetCode:Count and SayLeetCode
- mysql中count的用法MySql