You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
adding Coalesce in subquery in query like Select ID, Coalesce(Select SUM() ...) FROM SOME_TABLE do double plans and double count of reads from [CORE1722]
#849
Submitted by: @livius2
Duplicates CORE501
select
(SELECT SUM(DMD.ILOSC) FROM DOC_MAG_DET DMD WHERE DMD.ID_DOC_MAG=http://DM.ID)
FROM
DOC_MAG DM
plans:
PLAN (DMD INDEX (FK_DOC_MAG_DET__ID_DOC_MAG))
PLAN (DM NATURAL)
example record reads from DMD 5000
but after adding only Coalesce
select
COALESCE((SELECT SUM(DMD.ILOSC) FROM DOC_MAG_DET DMD WHERE DMD.ID_DOC_MAG=http://DM.ID), 0)
FROM
DOC_MAG DM
plans:
PLAN (DMD INDEX (FK_DOC_MAG_DET__ID_DOC_MAG))
PLAN (DMD INDEX (FK_DOC_MAG_DET__ID_DOC_MAG))
PLAN (DM NATURAL)
record reads from DMD are now 2x5000 = 10000
this do performance degradation
The text was updated successfully, but these errors were encountered: