我正在执行一个如下所示的select语句,执行时间超过6分钟.
select * from table where col1 is null;
Run Code Online (Sandbox Code Playgroud)
然而:
select * from table;
Run Code Online (Sandbox Code Playgroud)
几秒后返回结果.该表包含2500万条记录.没有使用索引.有一个复合PK,但没有使用col.在具有5000万条记录的不同表上执行时,查询相同,在几秒钟内返回结果.只有这张桌子有问题.
重建表格以检查是否有错过,但仍面临同样的问题.
有人可以帮我解释为什么需要时间吗?数据类型:VARCHAR2(40)PLAN:
Plan hash value: 2838772322
---------------------------------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
---------------------------------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 1 | 794 | 60973 (16)| 00:00:03 |
|* 1 | TABLE ACCESS STORAGE FULL| table | 1 | 794 | 60973 (16)| 00:00:03 |
---------------------------------------------------------------------------------------------------
Predicate Information (identified by operation id):
---------------------------------------------------
1 - …Run Code Online (Sandbox Code Playgroud)