Subject RE: [firebird-support] More indexed reads with FB 2.0
Author Leyne, Sean
Guido,

> select BLPCID,sum(BLGROSS_SALES),sum(BLRETURNS),sum(BLNETSALES),
> sum(BLDELIVERY_QUANTITY),sum(BLBACKLOG)
> from BACKLOG left join TURNOVER_PC_CS on BLPCID=TO6PCID
> join CUSTOMERS on TO6CSID=CSID and CSUSID1=56 and CSGPID3=65
> where TO6PCID is null
> group by BLPCID
>
> but I don't get the right results. Any idea, where the error could be?


I noted that you are missing the following criteria which was in your
original example:

"from BACKLOG where BLCSSALESREPID=56 and BLCSGPID3=65..."

Does that explain the difference in the results?


Regarding the overall performance...

Do you have a compound index with includes BLCSSALESREPID and BLCSGPID3
on the BackLog table?

Do you have a compound index with includes CSID, CSUSID1 and CSGPID3 on
the Customer table?

Does adding the indexes improve things?


Sean