Subject Re: [firebird-support] Query taking too much time
Author Elmar Haneke
> Or look at the redundancy in your master-detail structure and
> simply ignore BILLTYPE. Presumably, the master can't have multiple
> billtypes, so all of the billitemdetails will be of the same
> billtype without needing to join on it.

Or provide combined indices on (BillNumber,BillType) for the join.
But, I would also assum "billtype" to be redundant here.