Sqlserver
 sql >> Teknologi Basis Data >  >> RDS >> Sqlserver

Rencana eksekusi tampilan yang dipartisi

Penulisan ulang ini menambahkan filter dengan predikat startup ke rencana dan menghindari mengakses tabel lainnya.

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 hasilnya adalah

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

Dibandingkan dengan hasil asli

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. Database
  2.   
  3. Mysql
  4.   
  5. Oracle
  6.   
  7. Sqlserver
  8.   
  9. PostgreSQL
  10.   
  11. Access
  12.   
  13. SQLite
  14.   
  15. MariaDB
  1. Mendapatkan kesalahan saat menjalankan skrip 50 MB di SQL Server 2008 R2

  2. Bagaimana cara memutar kolom teks di SQL Server?

  3. Paket SSIS berjalan 500x lebih lama di satu server

  4. Cara Menggunakan FILEGROUPPROPERTY() di SQL Server

  5. Tabel SQL Server:apa perbedaan antara @, # dan ##?