Ở đây bạn có danh sách các bảng cơ sở dữ liệu với hầu hết các hàng:
Tables - Rows count
Sales.SalesOrderDetail - 121317
Production.TransactionHistory - 113443
Production.TransactionHistoryArchive - 89253
Production.WorkOrder - 72591
Production.WorkOrderRouting - 67131
Sales.SalesOrderHeader - 31465
Sales.SalesOrderHeaderSalesReason - 27647
Person.Contact - 19972
Person.Address - 19614
Sales.CustomerAddress - 19220
Sales.Customer - 19185
Sales.ContactCreditCard - 19118
Sales.CreditCard - 19118
Sales.Individual - 18484
Sales.CurrencyRate - 13532
Bạn có thể thử biến thể khác nhau sử dụng mà bảng. Ví dụ: truy vấn này:
SELECT * FROM Sales.SalesOrderDetail s
INNER JOIN Production.Product p ON s.ProductID = p.ProductID
chạy trong 9 giây tại máy tính của tôi.
Bạn có thể chạy này:
SELECT * FROM Production.TransactionHistory th
INNER JOIN Production.TransactionHistoryArchive tha ON th.Quantity = tha.Quantity
Nội tham gia vào bảng unindexed. Ví dụ rất nhân tạo, nhưng bây giờ phải mất hơn 2 phút để cuộn trên máy của tôi. Bây giờ - hơn 20 phút. Hiện tại - 1h 20 phút.
Nguồn
2009-09-10 13:44:56
de-tối ưu hóa sớm là gốc của tất cả ... –