Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

SQL Server-the difference between heap tables and index tables

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Concept:

1. The storage location of heap table data is random when it is inserted, which is mainly determined by the idle condition of the internal blocks of the database. The data obtained is calculated according to the hit rate, and the data that is not necessarily inserted first can be found when scanning the table.

two。 Index table (iot) data storage is to store the table in the way of index, the data is ordered, the location of the data is predetermined, and has nothing to do with the order of insertion.

Advantages:

1. Stack tables, insert and update data quickly.

two。 Index table, query efficiency is higher than heap table.

Disadvantages:

1. Stack the table, the query speed is slow, is the full table scan.

two。 Index table, insert update data is slow, because the index also needs to be updated.

When to use an index table:

Suitable for information retrieval, spatial and OLAP programs.

1. Code lookup table.

2. Tables that are often accessed through the master code.

3. Build your own index structure.

4. Strengthen the common positioning of the data and require the data to be physically stored in a specific order.

5. Use between frequently. And... Query the master code or unique code. Data is physically classified and queried. Such as an order table, load the data by date, and want to check the orders and statistics of a single customer in different periods.

Reference:

Http://blog.csdn.net/magister_feng/article/details/6590311

Http://blog.csdn.net/xqy1522/article/details/6750252

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report