New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Execution of multiple stored procedures in some case is slow [CORE5782] #6045
Comments
Modified by: @livius2Attachment: Interbase.png [ 13228 ] Attachment: Firebird3.png [ 13229 ] Attachment: SLOWPROC.fbk [ 13230 ] |
Commented by: @livius2 One point to look into is when we change above query from LEFT to inner - of course totally different plan and resultset - then query run also quite instant on Firebird |
Commented by: @dyemanov FB is not able to use MERGE plan for outer joins (yet). |
Commented by: @livius2 Thank you for the info. |
Commented by: @dyemanov v4 (fingers crossed) |
Modified by: Sean Leyne (seanleyne)description: We are in point of migration of database from Interbase to Firebird and encountered slownes. one point in comparision is that Firebird for above query use on Firebird there are 561598 fetches I have attached difference with stats and sample database to test => We are in point of migration of database from Interbase to Firebird and encountered slownes. SELECT one point in comparision is that Firebird for above query use on Firebird there are 561598 fetches, whereas Interbase there are only 30199 fetches I have attached difference with stats and sample database to test |
Commented by: Sean Leyne (seanleyne) The Subject of this case seems wrong. It seems the issue is about the handling of SPs in JOINs, not about "multiple SP executions". |
Commented by: Sean Leyne (seanleyne) Karol, Then it seems that this case is a duplicate, no? |
Modified by: Sean Leyne (seanleyne)status: Open [ 1 ] => Resolved [ 5 ] resolution: Duplicate [ 3 ] |
Modified by: @pcisarstatus: Resolved [ 5 ] => Closed [ 6 ] |
Submitted by: @livius2
Is related to CORE4823
Duplicates CORE4823
Attachments:
Interbase.png
Firebird3.png
SLOWPROC.fbk
We are in point of migration of database from Interbase to Firebird and encountered slownes.
Below query run slow ~1s. With same shema this query run instant on Interbase.
We have analysed all procedures execution one by one and all looks fast with good plans.
But as whole it is slow compared to Interbase.
SELECT
D.DYR_ID
, D.DYR_NAZWA
, D2.DYR_ID AS MA_DYR_UPR
FROM DYREKCJA D
LEFT JOIN Pracownik_dyr_akcja(49, 0, 'ARozrachunkiKsiegowane', '') D2 ON D2.DYR_ID = D.DYR_ID
WHERE
D.OBSZAR_ID = 1
AND D.DYR_ID <> 0
ORDER BY D.DYR_NAZWA COLLATE PXW_PLK ASC
one point in comparision is that Firebird for above query use
PLAN SORT (JOIN (D INDEX (FK_DYREKCJA__OBSZAR), D2 NATURAL))
but Interbase
PLAN SORT (MERGE (SORT (D INDEX (RDB$FOREIGN323)),SORT ()))
on Firebird there are 561598 fetches, whereas Interbase there are only 30199 fetches
I have attached difference with stats and sample database to test
The text was updated successfully, but these errors were encountered: