gpt4 book ai didi

oracle - "TABLE ACCESS BY LOCAL INDEX ROWID"高估计成本

转载 作者:行者123 更新时间:2023-12-02 00:31:01 25 4
gpt4 key购买 nike

我在 Oracle 中有一个查询导致 OLAP 系统中的估计成本很高。估计行数只有 100K,但成本是一个巨大的数字。请问cost的数量是怎么计算的,在什么情况下会出现超高的预估成本?

执行计划:

  17 TABLE ACCESS BY LOCAL INDEX ROWID /BIC/FZ3PM_C01                                 
| ( Estim. Costs = 1,299,922,942,955,190 , Estim. #Rows = 104,711 )
| Pstart: 1 Pstop: 471
| Estim. CPU-Costs = 18,446,744,073,709,601,000 Estim. IO-Costs = 86,157,375,
|
--- 16 BITMAP CONVERSION TO ROWIDS
|
--- 15 BITMAP AND
|
|-- 7 BITMAP MERGE
| |
| --- 6 BITMAP KEY ITERATION
| |
| |-- 4 BUFFER SORT
| | |
| | ------3 TABLE ACCESS FULL /BIC/DZ3PM_C012
| | ( Estim. Costs = 4 , Estim. #Rows = 180 )
| | Estim. CPU-Costs = 1,093,126 Estim. IO-Costs = 4
| | Filter Predicates
| |
| ------5 BITMAP INDEX RANGE SCAN /BIC/FZ3PM_C01~050
| Pstart: 1 Pstop: 471
| Search Columns: 1
| Access Predicates
|
--- 14 BITMAP MERGE
|
--- 13 BITMAP KEY ITERATION
|
|-- 11 BUFFER SORT
| |
| --- 10 HASH JOIN
| | ( Estim. Costs = 2,492 , Estim. #Rows = 1,264,100 )
| | Estim. CPU-Costs = 801,483,146 Estim. IO-Costs = 2,407
| | Access Predicates
| |
| |-----8 TABLE ACCESS FULL /BI0/XMATERIAL
| | ( Estim. Costs = 1,470 , Estim. #Rows = 50,880 )
| | Estim. CPU-Costs = 403,451,418 Estim. IO-Costs = 1,427
| | Filter Predicates
| ------9 TABLE ACCESS FULL /BIC/DZ3PM_C011
| ( Estim. Costs = 1,007 , Estim. #Rows = 1,264,100 )
| Estim. CPU-Costs = 259,249,328 Estim. IO-Costs = 980
|
------12 BITMAP INDEX RANGE SCAN /BIC/FZ3PM_C01~040
Pstart: 1 Pstop: 471
Search Columns: 1
Access Predicates

最佳答案

100,000 行估计是输出。它可能需要做很多工作来过滤一个大数据集,甚至更多的工作来总结一个大数据集。也就是说,这些成本是天文数字(即使数据库的数据大小需要 400 多个分区)

尝试执行解释计划,然后执行 SELECT * FROM TABLE(DBMS_XPLAN.DISPLAY)

这提供了一个更具可读性的计划。您希望所有访问和过滤谓词都能看到它在做什么,以及汇总起来的成本。

关于oracle - "TABLE ACCESS BY LOCAL INDEX ROWID"高估计成本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6757738/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com