TAILIEUCHUNG - SQL Server MVP Deep Dives- P8

SQL Server MVP Deep Dives- P8: Each year Microsoft invites all the MVPs from every technology and country to Redmond for an MVP Summit—all top secret—“don’t tweet what you see!” During the MVP Summit, each product team holds a series of presentations where they explain their technologies, share their vision, and listen to some honest feedback. | 236 Chapter 17 Build your own index Tester_sp calls the tested procedure with four different search strings and records the number of rows returned and the execution time in milliseconds. The procedure makes two calls for each search string and before the first call for each string tester_sp also executes the command DBCC DROPCLEANBUFFERS to flush the buffer cache. Thus we measure the execution time both when reading from disk and when reading from memory. Of the four search strings two are three-letter strings that appear in 10 and 25 email addresses respectively. One is a five-letter string that appears in 1978 email addresses and the last string is a complete email address with a single occurrence. Here is how we test the plain_search procedure. You can also find this script in the file . CREATE PROCEDURE plain_search @word varchar 50 AS SELECT person_id first_name last_name birth_date email FROM persons WHERE email LIKE @word go EXEC tester_sp plain_search go The output when I ran it on my machine was as follows 6660 ms 10 rows. Word joy . 6320 ms 10 rows. Word joy . Data in cache 7300 ms 25 rows. Word aam . 6763 ms 25 rows. Word aam . Data in cache 17650 ms 1978 rows. Word niska . 6453 ms 1978 rows. Word niska . Data in cache. 6920 ms 1 rows. Word omamo@ . 6423 ms 1 rows. Word omamo@ . Data in cache. These are the execution times we should try to beat. Using the LIKE operator an important observation Consider this procedure CREATE PROCEDURE substring_search @word varchar 50 AS SELECT person_id first_name last_name birth_date email FROM persons WHERE substring email 2 len email @word This procedure does not meet the user requirements for our search. Nevertheless the performance data shows something interesting joy aam niska omamo@ Disk 5006 4726 4896 4673 Cache 296 296 296 296 The execution times for this procedure are better than those for plain_search and when the data is in cache the .

TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.