我将在各个方面详细说明一个非常慢的查询。你能给我一些建议来了解我应该考虑什么来加快速度吗?
它只涉及两个表。
SELECT /*+ leading(tb) */![enter image description here][1]
DISTINCT COUNT (huB.FLH_ID_MESSAGGIO), hub.flh_STATO, TB.LOTTO
FROM ENI_FLUSSI_HUB HUB, NETATEMP.TMP_GAB_RECOVERY_SCARTI tb
WHERE HUB.FLH_ID_MESSAGGIO = tb.FLH_ID_MESSAGGIO
AND hub.FLH_TIPO_PROCESSO_COD = tb.FLH_TIPO_PROCESSO_COD
AND TB.LOTTO IN (:"SYS_B_0", :"SYS_B_1", :"SYS_B_2", :"SYS_B_3")
AND HUB.FLH_FLAG_ANN = :"SYS_B_4"
GROUP BY hub.flh_STATO, TB.LOTTO
ORDER BY HUB.FLH_STATO
第一个索引脚本:
CREATE INDEX NETATEMP.ENI_ETAI_IDX2 ON NETATEMP.TMP_GAB_RECOVERY_SCARTI
(LOTTO, OPERATORE)
NOLOGGING
TABLESPACE NETATEMP_IDXTI
PCTFREE 10
INITRANS 2
MAXTRANS 255
STORAGE (
INITIAL 64K
NEXT 1M
MINEXTENTS 1
MAXEXTENTS UNLIMITED
PCTINCREASE 0
BUFFER_POOL DEFAULT
FLASH_CACHE DEFAULT
CELL_FLASH_CACHE DEFAULT
)
NOPARALLEL;