How to use SQL to optimize query efficiency - SQL is a powerful language, but many times it hides too many implementation details

Author: Zen and the Art of Computer Programming

1 Introduction

With the rapid development of the Internet, all walks of life are booming. In the mobile Internet era, both traffic and data are in an explosive period, and the rapid growth of large amounts of data will surely bring new business opportunities and new business needs. Traditional relational database systems cannot effectively support the storage and query of such massive data, so NoSQL (Not Only SQL) database systems have emerged. The NoSQL database system uses a high degree of abstraction of the data model and distributed structural design to make the data not only highly scalable, but also has extremely high data processing capabilities and query performance.

For SQL (Structured Query Language) statements, its execution efficiency directly affects the operating efficiency of the entire application program. Good SQL query optimization techniques can significantly improve application response speed, reduce server resource consumption, increase query throughput, and more. This article will start from the following two aspects to analyze SQL query optimization technology:

  1. SQL query parsing and execution plan tuning
  2. Index optimization and its query mode

2. Background introduction

What is SQL?

SQL, Structured Query Language, is an ANSI/ISO standard database language. It is used to access, manipulate and manage relational database management systems (RDBMS).

SQL is a declarative language, which means that the user tells the computer what they want to do, rather than specifying each step of the operation like a procedural programming language. In other words, SQL does not specify how a certain command should be executed step by step. Instead, it tells the database what results are required, and the database executes them in a preset way. This "inform rather than specify" feature makes writing SQL simple, easy and efficient.

Currently, there are two major versions of SQL: SQL-92 and SQL-99&

Guess you like

Origin blog.csdn.net/universsky2015/article/details/132784773