Оптимизация LIKE

env
Дата: 24.03.2011 18:36:34
dbms_photoshop,

external table + join?
dbms_photoshop
Дата: 24.03.2011 18:41:50
env
dbms_photoshop,

external table + join?
Table Expressions, Cardinality, SYS_OP_ATG and KOKBF$
comphead
Дата: 24.03.2011 18:42:09
env
dbms_photoshop,

external table + join?


+ pipelined
_Nikotin
Дата: 24.03.2011 18:46:11
comphead
+ pipelined

setting cardinality for pipelined and table functions
ASSOCIATE STATISTICS WITH FUNCTIONS ... USING ...
env
Дата: 24.03.2011 18:46:43
dbms_photoshop,

спасибо
comphead
Дата: 24.03.2011 18:52:52
dbms_photoshop,

да. спс. занятная статья
Глупый Телевизор
Дата: 30.01.2012 13:52:11
-2-
А если substr(f, 1,...)?
А в каких версиях оптимизатор настолько умный, что догадается в таком случае использовать индекс?
create table t (id varchar2(30) primary key);

Table created.

insert into t
select dbms_random.string('X',30)
from dual
connect by level <= 10000;

10000 rows created.

exec dbms_stats.gather_table_stats(user,'T',method_opt=>'FOR ALL COLUMNS SIZE SKEWONLY',cascade=>true);

PL/SQL procedure successfully completed.

explain plan for
select id
from t
where substr(id,1,2) = :X;

Explained.

select * from table(dbms_xplan.display);

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------
Plan hash value: 1601196873

--------------------------------------------------------------------------
| Id  | Operation         | Name | Rows  | Bytes | Cost (%CPU)| Time     |
--------------------------------------------------------------------------
|   0 | SELECT STATEMENT  |      |   100 |  3100 |    15   (0)| 00:00:01 |
|*  1 |  TABLE ACCESS FULL| T    |   100 |  3100 |    15   (0)| 00:00:01 |
--------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------

   1 - filter(SUBSTR("ID",1,2)=:X)

13 rows selected.