Hi Sean, 

Thanks for your reply. I did it, and you are right - selectivity is much 
better. 
But, what is not better is query execution time. 

Here are new data:

Query
------------------------------------------------
select distinct
articles.art_id,
articles.art_article_nr,
generic_articles.ga_id,
link_art.la_id,
link_la_typ.lat_sort sort,
link_la_typ.lat_sup_id bra_id,
articles.art_replacement
from link_la_typ
inner join generic_articles on lat_ga_id = ga_id
inner join link_art on lat_la_id = la_id
inner join articles on la_art_id = art_id
where lat_typ_id=:TYP_ID  and ga_id=:GA_ID
ORDER BY 7 ASC
       , 2 ASC

Plan
------------------------------------------------
PLAN SORT (SORT (JOIN (GENERIC_ARTICLES INDEX (GENERIC_ARTICLES_IDX1), 
LINK_LA_TYP INDEX (LINK_LA_TYP_IDX5), LINK_ART INDEX (LINK_ART_IDX1), ARTICLES 
INDEX (ARTICLES_IDX1))))

Query Time
------------------------------------------------
Prepare       : 31.00 ms
Execute       : 4,789.00 ms
Avg fetch time: 228.05 ms

Memory
------------------------------------------------
Current: 10,273,304
Max    : 129,710,544
Buffers: 2,048

Operations
------------------------------------------------
Read   : 3,049
Writes : 0
Fetches: 3,794
Marks  : 0

Tables now return:

ARTICLES - 79 indexed reads
GENERIC_ARTICLES - 1 indexed read
LINK_ART - 79 indexed reads
LINK_LA_TYP - 79 indexed reads

Any ideas other ideas ?

Regards,

Zoran
  • ... zilez2...@yahoo.com [firebird-support]
    • ... 'Leyne, Sean' s...@broadviewsoftware.com [firebird-support]
      • ... zilez2...@yahoo.com [firebird-support]
        • ... zilez2...@yahoo.com [firebird-support]
      • ... zilez2...@yahoo.com [firebird-support]
        • ... 'Leyne, Sean' s...@broadviewsoftware.com [firebird-support]
          • ... zilez2...@yahoo.com [firebird-support]
            • ... 'Leyne, Sean' s...@broadviewsoftware.com [firebird-support]
              • ... zilez2...@yahoo.com [firebird-support]
                • ... 'Leyne, Sean' s...@broadviewsoftware.com [firebird-support]
                • ... zilez2...@yahoo.com [firebird-support]
                • ... 'Louis van Alphen' lo...@nucleo.co.za [firebird-support]
                • ... Svein Erling Tysvær svein.erling.tysv...@kreftregisteret.no [firebird-support]
                • ... 'Louis van Alphen' lo...@nucleo.co.za [firebird-support]
                • ... zilez2...@yahoo.com [firebird-support]

Reply via email to