Subject Re: Optimze Query
Author nilsboedeker
Hi

i try:
> the In clause with Exists clause
>
> update article a set a.enabled=1
> where exists (select 1 from ARTICLE_CONTENTTREE_LINK al
> INNER JOIN SP_CT_VIDLIST_WITHROOT(104017) s ON
> (al.TREEID = s.RTREEID) where al.articleid=a.relid)
>
> regards
>
> Alexandre

No Index used...

Plan:
PLAN JOIN ((SP_CT_VIDLIST NATURAL)
PLAN (CONTENTTREE INDEX (RDB$PRIMARY2)), AL INDEX (RDB$PRIMARY52))
PLAN (A NATURAL)

Adapted plan:
PLAN JOIN ((SP_CT_VIDLIST NATURAL)
PLAN (CONTENTTREE INDEX (PK_CONTENTTREE)), AL
INDEXPK_ARTICLE_CONTENTTREE_LINK52))
PLAN (A NATURAL)
11 record(s) was(were) updated in ARTICLE

any more ideas or do you need more information?

with best regards

Nils