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

Express your experience in order to improve the efficiency of query

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

Share

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

Express your experience in order to improve the efficiency of query

The post of the former blogger

Http://www.cnblogs.com/zhangyabin---acm/p/5955001.html

When super-large business data are in the same table, but there are no other business fields to distinguish

You can use the following methods:

The business scenario is as follows: in a massive database, query the data of a row, and there is no way to exclude it through the business. For example, the amount of data under a certain category is very large, but it needs to be entered.

Real-time precise search of rows

Use fixed columns (that is, columns that do not change due to business changes, usually sequences or irregular UID strings) to add individual strings or numbers

In this way, you can get a number or string. Using these numbers or strings, you can distinguish between the data. The reference ideas are as follows.

First, divide the table according to the last bit of the sequence value so that 10 sub-tables can be split, reducing the amount of data queried by 10 times.

Character ID can be added by each character of a string to get a sub-table or a distinguishing condition.

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