sql >> Database teknologi >  >> RDS >> Sqlserver

Udførelsesplan for partitioneret visning

Denne omskrivning tilføjer filtre med opstartsprædikater til planen og undgår adgang til de andre tabeller.

SELECT *
FROM   TA
       OUTER APPLY (SELECT *
                    FROM   dbo.V
                    WHERE  TA.c = v.c
                           AND ta.id = v.id) CA
WHERE  TA.c = 2 

STATISTICS IO resultater af dette er

Table 'Worktable'. Scan count 0, logical reads 0, physical reads 0
Table 'T2'. Scan count 0, logical reads 2, physical reads 0
Table 'TA'. Scan count 0, logical reads 2, physical reads 0

Sammenlignet med de originale resultater af

Table 'T6'. Scan count 0, logical reads 2, physical reads 0
Table 'T5'. Scan count 0, logical reads 2, physical reads 0
Table 'T4'. Scan count 0, logical reads 2, physical reads 0
Table 'T3'. Scan count 0, logical reads 2, physical reads 0
Table 'T2'. Scan count 0, logical reads 2, physical reads 0
Table 'T1'. Scan count 0, logical reads 2, physical reads 0
Table 'TA'. Scan count 0, logical reads 2, physical reads 0



  1. Mysql problem ved oprettelse af en ny bruger

  2. Bryd murene ned! Sådan unsilo dine data

  3. Advarsel:PDO::__construct():[2002] Ingen sådan fil eller mappe (forsøger at oprette forbindelse via unix:///tmp/mysql.sock) i

  4. Tidszonekonvertering i SQL-forespørgsel