Subject | Is IB_Cursor really faster than IB_Query if joins involved? |
---|---|
Author | mmenaz |
Post date | 2002-02-15T11:22:11Z |
(IBO 4.2Fr, Firebird RC2)
Hi, I've a SQL with 4 table joins (one of them is a stored procedure), and since I use it for a report, I'm using a IB_Cursor, that should be faster and use less resources.
But, if I enter the SQL in the IB_Cursor editor, click prepare, then open and then click last, it takes, for instance, 10 seconds (I can hear IB_Cursor brain crunching ;).
If I do the same with a IB_Query, clicking on open it fills the grid in a snap (at it should, since the result set is only of 30 records).
Am I missing something?
Thanks
Marco Menardi
It's like:
SELECT MOVCON_TESTA.MOVCON_ID,
MOVCON_TESTA.ESERCIZIO_ID,
MOVCON_TESTA.CONDOMINIO_ID,
MOVCON_TESTA.CAUSALE_ID,
[CUT]
MOVCON_RIGHE.CONTO_ID,
[CUT]
CAUSALI.DESCRIZIONEDISP,
ESERCIZI.DESCRIZIONEDISP,
SEL_CODICI_CONTABILI.OUT_DESCRIZIONEDISP AS COD_CONT_DESCRIZIONE
FROM MOVCON_TESTA
INNER JOIN MOVCON_RIGHE ON (MOVCON_TESTA.MOVCON_ID = MOVCON_RIGHE.MOVCON_ID)
INNER JOIN SEL_CODICI_CONTABILI(MOVCON_TESTA.CONDOMINIO_ID, MOVCON_TESTA.ESERCIZIO_ID) ON
(MOVCON_RIGHE.CONTO_ID = SEL_CODICI_CONTABILI.OUT_CODICE_ID)
INNER JOIN CAUSALI ON (MOVCON_TESTA.CAUSALE_ID = CAUSALI.CAUSALE_ID)
INNER JOIN ESERCIZI ON (MOVCON_TESTA.ESERCIZIO_ID = ESERCIZI.ESERCIZIO_ID) AND (MOVCON_TESTA.CONDOMINIO_ID =
ESERCIZI.CONDOMINIO_ID)
Hi, I've a SQL with 4 table joins (one of them is a stored procedure), and since I use it for a report, I'm using a IB_Cursor, that should be faster and use less resources.
But, if I enter the SQL in the IB_Cursor editor, click prepare, then open and then click last, it takes, for instance, 10 seconds (I can hear IB_Cursor brain crunching ;).
If I do the same with a IB_Query, clicking on open it fills the grid in a snap (at it should, since the result set is only of 30 records).
Am I missing something?
Thanks
Marco Menardi
It's like:
SELECT MOVCON_TESTA.MOVCON_ID,
MOVCON_TESTA.ESERCIZIO_ID,
MOVCON_TESTA.CONDOMINIO_ID,
MOVCON_TESTA.CAUSALE_ID,
[CUT]
MOVCON_RIGHE.CONTO_ID,
[CUT]
CAUSALI.DESCRIZIONEDISP,
ESERCIZI.DESCRIZIONEDISP,
SEL_CODICI_CONTABILI.OUT_DESCRIZIONEDISP AS COD_CONT_DESCRIZIONE
FROM MOVCON_TESTA
INNER JOIN MOVCON_RIGHE ON (MOVCON_TESTA.MOVCON_ID = MOVCON_RIGHE.MOVCON_ID)
INNER JOIN SEL_CODICI_CONTABILI(MOVCON_TESTA.CONDOMINIO_ID, MOVCON_TESTA.ESERCIZIO_ID) ON
(MOVCON_RIGHE.CONTO_ID = SEL_CODICI_CONTABILI.OUT_CODICE_ID)
INNER JOIN CAUSALI ON (MOVCON_TESTA.CAUSALE_ID = CAUSALI.CAUSALE_ID)
INNER JOIN ESERCIZI ON (MOVCON_TESTA.ESERCIZIO_ID = ESERCIZI.ESERCIZIO_ID) AND (MOVCON_TESTA.CONDOMINIO_ID =
ESERCIZI.CONDOMINIO_ID)