Om man har en SP som är relaterad till 5 olika tabeller och man gör en körning. Det är ingen större skillnad om du har indexerat rätt. Prestandaproblem?Tidsvinst?
Hur myckte längre tid tar det om man gämför att man skapat 1 tabell där man redan skapat alla relationer i en o samma tabell och kör samma sökning i en SP.
SELECT bo_Match.MatchId, bo_Match.MatchNo, bo_Match.MatchDate, bo_Hall.HallId, bo_Division.DivisionName, bo_Licence.LicNbr,
bo_Licence.FirstName + ' ' + bo_Licence.SurName AS Name,
bo_MatchResult.MatchResultShirtNo, bo_MatchResult.MatchResultRoundResult1, bo_MatchResult.MatchResultRoundResult2,
bo_MatchResult.MatchResultRoundResult3, bo_MatchResult.MatchResultRoundResult4, bo_MatchResult.MatchResultRankPoint1,
bo_MatchResult.MatchResultRankPoint2, bo_MatchResult.MatchResultRankPoint3, bo_MatchResult.MatchResultRankPoint4
FROM bo_Match INNER JOIN
bo_Division ON bo_Match.MatchDivisionId = bo_Division.DivisionId INNER JOIN
bo_Hall ON bo_Match.MatchHallId = bo_Hall.HallId INNER JOIN
bo_MatchResult ON bo_Match.MatchId = bo_MatchResult.MatchResultMatchId INNER JOIN
bo_Licence ON bo_MatchResult.MatchResultLicNbr = bo_Licence.LicNbr
WHERE (bo_Match.MatchId = 2114762)
Sv: Tidsvinst?
Du ska sätta index på alla fält som ingår i join & where först och främst.