MySql query optimization Summary (1)

Source: Internet
Author: User
Tags mysql query optimization
MySql query optimization Summary (1) 1. Big Data paging query, varchar and other large fields to load the Common Code: SELECTaj. N_BH, aj. C_AM, aj. C_AHFROMt_ajASajORDERBYaj.D_LARQDESCLIMIT100, 10? 10 million pieces of data, query time? 0.73 s? After optimization: selectaj. C_AM, aj. C_AH, aj. N_BHFRO

MySql query optimization Summary (1) 1. Big Data paging query, varchar, and other large fields are lazy loaded. Common Code: SELECT aj. n_BH, aj. c_AM, aj. c_AHFROM t_aj AS ajORDER BY aj. d_LARQ DESCLIMIT 100,10? 10 million data records, query time? 0.73 s? After optimization: select aj. C_AM, aj. C_AH, aj. N_BHFRO

MySql query optimization Summary (1)

1. Big Data paging query, varchar, and other large fields are lazily loaded

Common Code:

SELECT aj. N_BH, aj. C_AM, aj. C_AHFROM t_aj AS ajORDER BY aj. D_LARQ DESCLIMIT 100,10

? 10 million data records, query time? 0.73 s

?

After optimization:

Select aj. c_AM, aj. c_AH, aj. n_BHFROM (SELECT aj. n_BH, aj. d_LARQFROM t_aj AS ajORDER BY aj. d_LARQ DESCLIMIT 100,10) T inner join t_aj aj on t. n_BH = aj. n_BH

? 10 million data records, query time? 0.17 s

?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.