SQL
> var a varchar2(10);
SQL> exec :a:='INVALID';
PL/SQL procedure successfully completed.
SQL> set autot rac e on
SQL> select object_id,status from t1 where status=:a;
OBJECT_ID STATUS
---------- -------
92 INVALID
93 INVALID
94 INVALID
95 INVALID
96 INVALID
97 INVALID
98 INVALID
99 INVALID
100 INVALID
73871 INVALID
73846 INVALID
Execution Plan
----------------------------------------------------------
Plan hash value: 3617692013
--------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
--------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 23680 | 462K| 284 (1)| 00:00:04 |
|* 1 | TABLE ACCESS FULL| T1 | 23680 | 462K| 284 (1)| 00:00:04 |
--------------------------------------------------------------------------
Predicate Information (identified by operation id):
---------------------------------------------------
1 - filter("STATUS"=:A)
Statistics
----------------------------------------------------------
403 recursive calls
0 db block gets
99 consistent gets
19 physical reads
0 redo size
2543 bytes sent via SQL*Net to client
589 bytes received via SQL*Net from client
8 SQL*Net roundtrips to/from client
7 sorts (memory)
0 sorts (disk)
99 rows processed
SQL> select status,count(1) from t1 group by status;
STATUS COUNT(1)
------- ----------
IND 2
VALID
SQL> exec :a:='INVALID';
PL/SQL procedure successfully completed.
SQL> set autot rac e on
SQL> select object_id,status from t1 where status=:a;
OBJECT_ID STATUS
---------- -------
92 INVALID
93 INVALID
94 INVALID
95 INVALID
96 INVALID
97 INVALID
98 INVALID
99 INVALID
100 INVALID
73871 INVALID
73846 INVALID
Execution Plan
----------------------------------------------------------
Plan hash value: 3617692013
--------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
--------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 23680 | 462K| 284 (1)| 00:00:04 |
|* 1 | TABLE ACCESS FULL| T1 | 23680 | 462K| 284 (1)| 00:00:04 |
--------------------------------------------------------------------------
Predicate Information (identified by operation id):
---------------------------------------------------
1 - filter("STATUS"=:A)
Statistics
----------------------------------------------------------
403 recursive calls
0 db block gets
99 consistent gets
19 physical reads
0 redo size
2543 bytes sent via SQL*Net to client
589 bytes received via SQL*Net from client
8 SQL*Net roundtrips to/from client
7 sorts (memory)
0 sorts (disk)
99 rows processed
SQL> select status,count(1) from t1 group by status;
STATUS COUNT(1)
------- ----------
IND 2
VALID