Quiz questions seem to be in nowadays, so here's one for you regarding the cost based optimizer:
Given this simple script (Run this on any 10.2.x (including XE) or 11.1.0.6/7):
create table test2
as
select * from dba_objects;
create index i_test1_1 on test1(object_name);
create index i_test1_2 on test1(object_id);
create index i_test2_1 on test2(object_name);
create index i_test2_2 on test2(object_id);
exec dbms_stats.gather_table_stats(null, 'TEST1', estimate_percent=>null, method_opt=>'for all columns size 1');
exec dbms_stats.gather_table_stats(null, 'TEST2', estimate_percent=>null, method_opt=>'for all columns size 1');
And this simple query:
with this plan:
Plan 1 (the obvious one):
------------------------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
------------------------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 2 | 212 | 6 (0)| 00:00:01 |
| 1 | NESTED LOOPS SEMI | | 2 | 212 | 6 (0)| 00:00:01 |
Recent comments
3 years 1 min ago
3 years 12 weeks ago
3 years 16 weeks ago
3 years 17 weeks ago
3 years 21 weeks ago
3 years 43 weeks ago
4 years 11 weeks ago
4 years 40 weeks ago
5 years 25 weeks ago
5 years 25 weeks ago