Kinh doanh - Marketing
Kinh tế quản lý
Biểu mẫu - Văn bản
Tài chính - Ngân hàng
Công nghệ thông tin
Tiếng anh ngoại ngữ
Kĩ thuật công nghệ
Khoa học tự nhiên
Khoa học xã hội
Văn hóa nghệ thuật
Sức khỏe - Y tế
Văn bản luật
Nông Lâm Ngư
Kỹ năng mềm
Luận văn - Báo cáo
Giải trí - Thư giãn
Tài liệu phổ thông
Văn mẫu
Giới thiệu
Đăng ký
Đăng nhập
Tìm
Danh mục
Kinh doanh - Marketing
Kinh tế quản lý
Biểu mẫu - Văn bản
Tài chính - Ngân hàng
Công nghệ thông tin
Tiếng anh ngoại ngữ
Kĩ thuật công nghệ
Khoa học tự nhiên
Khoa học xã hội
Văn hóa nghệ thuật
Y tế sức khỏe
Văn bản luật
Nông lâm ngư
Kĩ năng mềm
Luận văn - Báo cáo
Giải trí - Thư giãn
Tài liệu phổ thông
Văn mẫu
Thông tin
Điều khoản sử dụng
Quy định bảo mật
Quy chế hoạt động
Chính sách bản quyền
Giới thiệu
Đăng ký
Đăng nhập
0
Trang chủ
Công Nghệ Thông Tin
Cơ sở dữ liệu
Pro MySQL experts voice in open source phần 5
Đang chuẩn bị liên kết để tải về tài liệu:
Pro MySQL experts voice in open source phần 5
Diệu Thúy
58
77
pdf
Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ
Tải xuống
Tham khảo tài liệu 'pro mysql experts voice in open source phần 5', công nghệ thông tin, cơ sở dữ liệu phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | 276 CHAPTER 7 ESSENTIAL SQL If you felt that a more efficient join order would be to use the order given in the SELECT statement you would use the STRAIGHT_JOIN hint as shown in Listing 7-37. Listing 7-37. Example of the STRAIGHT_JOINHint mysql EXPLAIN - SELECT - FROM Category c - STRAIGHTJOIN Product2Category p2c - STRAIGHTJOIN Product p - WHERE c.name LIKE VideO - AND c.category_id p2c.category_id - AND p2c.product_id p.product_id G 1. row id 1 select_type SIMPLE table c type ALL possible_keys PRIMARY key NULL key_len NULL ref NULL rows 14 Extra Using where 2. row id 1 select_type SIMPLE table p2c type index possible_keys PRIMARY key PRIMARY key_len 8 ref NULL rows 8 Extra Using where Using index 3. row id 1 select_type SIMPLE table p type eq_ref possible_keys PRIMARY key PRIMARY key_len 4 ref ToyStore.p2c.product_id rows 1 Extra 3 rows in set 0.00 sec CHAPTER 7 ESSENTIAL SQL 277 As you can see MySQL dutifully follows your desired join order. The access pattern it comes up with in this case is suboptimal compared with the original MySQL-chosen access path. Where in the original EXPLAIN from Listing 7-36 you see MySQL using ref and eq_ref access types for the joins to Product2Category and Category in the STRAIGHT_JOIN EXPLAIN Listing 7-37 you see MySQL has reverted to using an index scan on Product2Category and an eq_ref to access Product. In this case the STRAIGHT_JOIN made things worse. In most cases MySQL will indeed choose the most optimal pattern for accessing tables in your SELECT statements. However if you encounter a situation in which you suspect a different order would produce speedier results you can use this technique to test your theories. Caution If you do find a situation in which you suspect changing the join order would speed up a query make sure that MySQL is using up-to-date statistics on your table before making any changes. After you run a baseline EXPLAIN to see MySQL s chosen access strategy for your query run an ANALYZE TABLE against the .
TÀI LIỆU LIÊN QUAN
Ebook Pro PHP security
Pro MySQL experts voice in open source phần 1
Pro MySQL experts voice in open source phần 2
Pro MySQL experts voice in open source phần 3
Pro MySQL experts voice in open source phần 4
Pro MySQL experts voice in open source phần 5
Pro PHP Application Performance
Pro MySQL experts voice in open source phần 6
Pro MySQL experts voice in open source phần 7
Pro MySQL experts voice in open source phần 8
crossorigin="anonymous">
Đã 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.