我正在尝试优化特定查询 我尝试使用哈希表,但性能没有那么大提高 我需要三次加入同一个表 - pratichesteps - 然后最终加入 - pratiche - table 这是查询
SELECT DISTINCT dbo.PRATICHESTEPS.IDPraticaStep AS IDPraticaEsame,
PRATICHESTEPS_3.IDPraticaStep AS IDPraticaCatena,
dbo.PRATICHE.IDSysStato AS IDStatoCatena,
dbo.PRATICHE.IDPraticaAccorpata,
PRATICHESTEPS_3.IDAnalisiStep,
dbo.PRATICHE.IDTipoAtto,
PRATICHESTEPS_3.Accorpamento,
dbo.PRATICHE.DataRegistrazione,
PRATICHESTEPS_3.LastStep
FROM dbo.PRATICHESTEPS
INNER JOIN dbo.PRATICHESTEPS AS PRATICHESTEPS_1
ON dbo.PRATICHESTEPS.IDPraticaCarico = PRATICHESTEPS_1.IDPraticaCarico
INNER JOIN dbo.PRATICHESTEPS AS PRATICHESTEPS_2
ON PRATICHESTEPS_1.IDPraticaStep = PRATICHESTEPS_2.IDPraticaStep
INNER JOIN dbo.PRATICHESTEPS AS PRATICHESTEPS_3
ON PRATICHESTEPS_2.IDPraticaCarico = PRATICHESTEPS_3.IDPraticaCarico
INNER JOIN dbo.PRATICHE
ON PRATICHESTEPS_3.IDPraticaStep = dbo.PRATICHE.IDPratica