Subject RE: [firebird-support] Re: Stumped on SQL Indexing/Bad Plan-ing
Author Svein Erling Tysvær
>Hi Svein,
>
>Here is the PLAN that goes with that SQL. I should have included it in the first message.
>
>PLAN SORT (SORT (JOIN (S INDEX (IDX_JET_SAV_PNT5), L INDEX (IDX_JET_CHG_LOG3), F INDEX
>(UNQ_JET_FLD_NMS_2), T INDEX >(UNQ_JET_TBL_NMS_1))))
>
>When I execute this the first time, it takes 9 seconds. I think the 6 second saving was
>only because I was re-executing it and FB kept a cache or something that helped out the
>subsequent executions.
>
>The 2 SORTs at the begining are probably what's killing my timings. Should I add an index
>some where to get rid of them?
>
>Thanks in advance for any help you can provide. This is the only remaining "slow point" in
>my application. (After 10 months of programming)

I think the plan seems fine, although it might be interesting to see which fields each of the above mentioned indexes refer to and the definition of those fields. When you talk about VARCHARs and BLOBs, I assume you mean that you put them in the fields that you SELECT, not in the JOIN clause itself? Is it slow if you join all tables, but don't select from anywhere except S?

Set