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

Some methods of optimizing Mysql

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

Share

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

The following mainly brings you some ways to optimize Mysql. I hope these words can bring you practical use. This is also the main purpose of this article that I edit some methods of optimizing Mysql. All right, don't talk too much nonsense, let's just read the following.

1. Application access optimization

1)。 Reduce data access (Nosql role) 2). Return less data 3). Reduce the number of interactions (Nosql effect)

two。 CVM hardware selection

1)。 Data SSD (solid state) 2). Log SAS (enterprise level)

3. Operating system optimization (LINUX / SWAP (virtual memory))

1). LINUX 2) Set up SWAP (virtual memory) 3). Turn off NUMA feature 4). Network card optimization (dual network cards are made into BOND (0 / 1 / 6) or adjust network parameters) 5). Disk scheduling settings (DEADLINE / NOOP / CFQ) 6). File system (XFS / EXT4 / NOATIME / NOBARRIER)

4. Database optimization

1)。 Database instantiation optimization 2). SQL statement optimization a). Choose a valid join order (from from left to right; where from bottom to top, right to left; group by,order by from left to right). Avoid producing Cartesian product c). Avoid using * (need to query data dictionary) d). Replace the having clause with where clause e) .in is suitable for large appearance and small inner table; exist is suitable for small appearance and large inner table f). Use exists instead of distinct g). Avoid implicit data type conversion h). Use indexes to avoid sorting operations I). Try to use the front-end matching fuzzy search (Column like 'ABC%') j). Do not index k in fields with low selectivity. Avoid column operations (mathematical expression operations on fields in where conditions) l). Try to get rid of in, or, (index failure) m. Avoid using is null or not n on index columns. Batch submission of sql

For the above optimization of some of the methods of Mysql, we do not think it is very helpful. If you need to know more, please continue to follow our industry information. I'm sure you'll like it.

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

Wechat

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

12
Report