Get the App
SLTechnology News&Howtos  ›  Development  › 

Introduction and creation method of mysql histogram

Shulou Source: shulou.com Published: 2022-06-03 17:28:44 11月13日 Update

This article mainly introduces "the introduction and creation method of mysql histogram". In the daily operation, I believe that many people have doubts about the introduction and creation method of mysql histogram. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the doubts of "introduction and creation method of mysql histogram". Next, please follow the editor to study!

1. Histogram is the distribution form of data. If you sort the names in alphabetical order, you can put the people with the letters A to F into the logical bucket.

Put the person who starts from G to J into another, and so on. The optimizer assumes that the data is evenly distributed in the column, but it is mostly uneven in actual use.

2. MySQL provides two kinds of histograms: the equal height type in which all data is distributed evenly in the bucket and the equal width type in which a single value is in a single bucket.

Up to 1024 storage cans can be set. The selection of the number of data storage tanks depends on many factors, including the value after weight removal, the tilt of the data, and the accuracy of the required results. If the number of barrels exceeds a certain threshold, the revenue generated by the barrel mechanism will begin to decrease.

Example

The following command creates a histogram of 10 buckets on column C1 of table t:

ANALYZE TABLE t UPDATE HISTOGRAM ON C1 WITH 10 BUCKETS;, the study on "introduction and creation of mysql histogram" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Tags: Histogram method data learning tank single letter beginning quantity more help practical next accuracy depending on command factor name example actual Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Information Shulou Tech Info Docker MariaDB Xiaomi