By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
2 rows affected
256 rows affected
1 rows affected
259 rows affected
1 rows affected
| A | COUNT(*) |
|---|---|
| 2 | 2 |
| 1 | 516 |
| SUM(A) |
|---|
| 4 |
| PLAN_TABLE_OUTPUT |
|---|
| SQL_ID cw3ag7gkjpfb4, child number 0 |
| ------------------------------------- |
| select /*+ gather_plan_statistics */ sum(A) from DEMO where A=2 |
| Plan hash value: 2842824019 |
| --------------------------------------------------------------------------------------- |
| | Id | Operation | Name | Starts | E-Rows | A-Rows | A-Time | Buffers | |
| --------------------------------------------------------------------------------------- |
| | 0 | SELECT STATEMENT | | 1 | | 1 |00:00:00.01 | 2 | |
| | 1 | SORT AGGREGATE | | 1 | 1 | 1 |00:00:00.01 | 2 | |
| |* 2 | INDEX RANGE SCAN| DEMO_AB | 1 | 2 | 2 |00:00:00.01 | 2 | |
| --------------------------------------------------------------------------------------- |
| Predicate Information (identified by operation id): |
| --------------------------------------------------- |
| 2 - access("A"=2) |
| Note |
| ----- |
| - dynamic statistics used: dynamic sampling (level=2) |
| SUM(B) |
|---|
| 0 |
| PLAN_TABLE_OUTPUT |
|---|
| SQL_ID 65cjxtvwydbpc, child number 0 |
| ------------------------------------- |
| select /*+ gather_plan_statistics */ sum(B) from DEMO where A=2 |
| Plan hash value: 2842824019 |
| --------------------------------------------------------------------------------------- |
| | Id | Operation | Name | Starts | E-Rows | A-Rows | A-Time | Buffers | |
| --------------------------------------------------------------------------------------- |
| | 0 | SELECT STATEMENT | | 1 | | 1 |00:00:00.01 | 2 | |
| | 1 | SORT AGGREGATE | | 1 | 1 | 1 |00:00:00.01 | 2 | |
| |* 2 | INDEX RANGE SCAN| DEMO_AB | 1 | 2 | 2 |00:00:00.01 | 2 | |
| --------------------------------------------------------------------------------------- |
| Predicate Information (identified by operation id): |
| --------------------------------------------------- |
| 2 - access("A"=2) |
| Note |
| ----- |
| - dynamic statistics used: dynamic sampling (level=2) |
| SUM(C) |
|---|
| 0 |
| PLAN_TABLE_OUTPUT |
|---|
| SQL_ID 1yukcgvh7d3x3, child number 0 |
| ------------------------------------- |
| select /*+ gather_plan_statistics */ sum(C) from DEMO where A=2 |
| Plan hash value: 1078896418 |
| ---------------------------------------------------------------------------------------------------------- |
| | Id | Operation | Name | Starts | E-Rows | A-Rows | A-Time | Buffers | |
| ---------------------------------------------------------------------------------------------------------- |
| | 0 | SELECT STATEMENT | | 1 | | 1 |00:00:00.01 | 3 | |
| | 1 | SORT AGGREGATE | | 1 | 1 | 1 |00:00:00.01 | 3 | |
| | 2 | TABLE ACCESS BY INDEX ROWID BATCHED| DEMO | 1 | 2 | 2 |00:00:00.01 | 3 | |
| |* 3 | INDEX RANGE SCAN | DEMO_AB | 1 | 2 | 2 |00:00:00.01 | 2 | |
| ---------------------------------------------------------------------------------------------------------- |
| Predicate Information (identified by operation id): |
| --------------------------------------------------- |
| 3 - access("A"=2) |
| Note |
| ----- |
| - dynamic statistics used: dynamic sampling (level=2) |