Subject | Query optimisation |
---|---|
Author | Dorin Vasilescu |
Post date | 2004-04-06T10:01:42Z |
Hi all.
It is possible to make this query fully optimizable?
select * from catalog_produse where cod_producator in
(select cod_producator from catalog_produse where cod_original like
?parameter)
The PLAN is
PLAN (CATALOG_PRODUSE INDEX (CATALOG_PRODUSE_IDX3))
PLAN (CATALOG_PRODUSE NATURAL)
Indexes:
CATALOG_PRODUSE_IDX2 on cod_original
CATALOG_PRODUSE_IDX3 on cod_producator
The query is slow on a 50000 rows table, because, I think, the index
on cod_original is not used.
Only few rows are returned (average 5 rows)
Thanks in advance
It is possible to make this query fully optimizable?
select * from catalog_produse where cod_producator in
(select cod_producator from catalog_produse where cod_original like
?parameter)
The PLAN is
PLAN (CATALOG_PRODUSE INDEX (CATALOG_PRODUSE_IDX3))
PLAN (CATALOG_PRODUSE NATURAL)
Indexes:
CATALOG_PRODUSE_IDX2 on cod_original
CATALOG_PRODUSE_IDX3 on cod_producator
The query is slow on a 50000 rows table, because, I think, the index
on cod_original is not used.
Only few rows are returned (average 5 rows)
Thanks in advance