... Also this behavior does not appear when the column is nunmber or varchar and
not load in order of this column ..
yes it does??? many examples on this site.
here is one - id1 and id2 both get about 1,000 rows from my table in the following (my all_objects has about 71-72,000 rows)
One query below uses and index - one does not. All because of the CLUSTERING FACTOR.
and they are numbers.
The clustering factor is what is causing what you are seeing - inspect them - and you'll find the clustering factor on last_analyzed is high while the clustering factor on the other attributes it likely much lower.
ops$tkyte%ORA11GR2> create table t
2 as
3 select mod(rownum,71) id1,
4 trunc(rownum/1000) id2,
5 a.*
6 from all_objects a
7 /
Table created.
ops$tkyte%ORA11GR2>
ops$tkyte%ORA11GR2> create index t_idx1 on t(id1);
Index created.
ops$tkyte%ORA11GR2> create index t_idx2 on t(id2);
Index created.
ops$tkyte%ORA11GR2>
ops$tkyte%ORA11GR2> select index_name, clustering_factor from user_indexes where index_name in ( 'T_IDX1', 'T_IDX2' );
INDEX_NAME CLUSTERING_FACTOR
------------------------------ -----------------
T_IDX1 71298
T_IDX2 1082
ops$tkyte%ORA11GR2> set autotrace traceonly explain
ops$tkyte%ORA11GR2> select * from t where id1 = 42;
Execution Plan
----------------------------------------------------------
Plan hash value: 1601196873
--------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
--------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 1010 | 181K| 303 (1)| 00:00:04 |
|* 1 | TABLE ACCESS FULL| T | 1010 | 181K| 303 (1)| 00:00:04 |
--------------------------------------------------------------------------
Predicate Information (identified by operation id):
---------------------------------------------------
1 - filter("ID1"=42)
Note
-----
- dynamic sampling used for this statement (level=2)
ops$tkyte%ORA11GR2> select * from t where id2 = 42;
Execution Plan
----------------------------------------------------------
Plan hash value: 3371054274
--------------------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
--------------------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 1000 | 179K| 22 (0)| 00:00:01 |
| 1 | TABLE ACCESS BY INDEX ROWID| T | 1000 | 179K| 22 (0)| 00:00:01 |
|* 2 | INDEX RANGE SCAN | T_IDX2 | 1000 | | 3 (0)| 00:00:01 |
--------------------------------------------------------------------------------------
Predicate Information (identified by operation id):
---------------------------------------------------
2 - access("ID2"=42)
Note
-----
- dynamic sampling used for this statement (level=2)