Subject | Re: FB 1.5.2 takes longer than IB 6.0.2 to run simple SQL Statement |
---|---|
Author | hi_feroz |
Post date | 2005-01-26T07:52:46Z |
Thanks Gary,
Yes, your SQL takes just 2 sec to run it on FB.
And mine where I call stored procedure in select statement takes 3
sec instead. The reason, I use this procedure is becaus I call it
from many queries. And at times, there could be a change in business
rules for example "R" means registered courses. Now I need to
include "I" as well which stands for Independent Study. So, I just
need to change one procedure instead of many queries. Yes, it may be
a little slow.
Regarding, my query running slow on FB as I has posted earlier. I
guess, there was something wrong in my home PC or FB installation
there. I tried samething in office PC, FB is much much faster.
Thanks to all these friends here who made FB available.
Feroz
Yes, your SQL takes just 2 sec to run it on FB.
And mine where I call stored procedure in select statement takes 3
sec instead. The reason, I use this procedure is becaus I call it
from many queries. And at times, there could be a change in business
rules for example "R" means registered courses. Now I need to
include "I" as well which stands for Independent Study. So, I just
need to change one procedure instead of many queries. Yes, it may be
a little slow.
Regarding, my query running slow on FB as I has posted earlier. I
guess, there was something wrong in my home PC or FB installation
there. I tried samething in office PC, FB is much much faster.
Thanks to all these friends here who made FB available.
Feroz
> I can't imagine why IB 6 would have been faster with that samequery, so as
> a step in (hopefully) the right direction, run the following queryand see
> if it improves things. Only difference is it uses proper joinsyntax and
> eliminates the inefficient procedure. The procedure should have hadR.CRS_SECTION =
> matric_no as an input param as well..
> I assume there is an index on CRSREGCRE( MATRIC_NO).
>
> SELECT
> R.CRS_CODE, R.MATRIC_NO, R.CRS_SECTION,
> R.STU_CRS_STATUS_CODE,
> R.CRS_NAME, R.CRS_CR_HRS,
> O.CRS_CODE, O.VNU_CODE, O.VNU_CODE_2,
> O.VNU_CODE_3,O.SLOT_DESC, O.SLOT_DESC_2, O.SLOT_DESC_3,
> S.STU_NAME, S.STU_PRG_CODE,
> (SELECT SUM(CRS_CR_HRS)
> FROM CRSREGCRE
> WHERE STR_CODE = R.STR_CODE AND
> STU_CRS_STATUS_CODE = 'R' AND
> MATRIC_NO = R.MATRIC_NO
> GROUP BY MATRIC_NO) AS TOTAL_CR_HRS
> FROM CRSREGCRE R
> INNER JOIN CRSOFFERCRE O ON R.CRS_CODE = O.CRS_CODE AND
> O.CRS_SECTION AND R.STR_CODE = O.STR_CODE
> INNER JOIN STUMST S ON R.MATRIC_NO = S.MATRIC_NO
> WHERE R.STR_CODE = '2004200501'
> ORDER BY R.MATRIC_NO, R.CRS_CODE
>
> FWIW
> Gary