Home  >  Article  >  Database  >  Summary and sharing on how to improve efficiency and safety

Summary and sharing on how to improve efficiency and safety

巴扎黑
巴扎黑Original
2017-06-11 11:48:411319browse

1. To optimize the query, try to avoid full table scans. First, consider creating indexes on the columns involved in where and order by. 2. Try to avoid judging the null value of the field in the where clause, otherwise the engine will give up using the index and perform a full table scan, such as: select id from t where num is null you can set the default value 0 on num to ensure There is no null value in the num column in the table, and then query like this: select id from t where num=0 3. Try to avoid using != or <> operators in the where clause, otherwise the engine will give up using the index and perform a full table scan. 4. Try to avoid using or in the where clause to connect conditions, otherwise the engine will give up using the index and perform a full table scan, such as: select&nbs

1. How to increase the number of millions Database query speed of

Summary and sharing on how to improve efficiency and safety

## Introduction: When optimizing queries, full table scans should be avoided as much as possible. You should first consider creating indexes on the columns involved in where and order by. 2. Try to avoid judging the null value of the field in the where clause, otherwise the engine will give up using the index and perform a full table scan, such as: Select id from t where num is null You can set the default value 0 on num to ensure There is no null value in the num column in the table, and then query like this:

2. Improving the security of the MySQL database (3)

Summary and sharing on how to improve efficiency and safety

# Introduction: Talk about how to improve the security of MySQL database from the perspective of user permissions. As the saying goes, knowledge is power. Please make sure you understand MySQL's permission system and the consequences of granting specific permissions. Please do not grant unnecessary permissions to any user. The garnt table should be viewed to confirm this.

3. Improving the security of MySQL database (4)

Summary and sharing on how to improve efficiency and safety

Introduction: Talk about how to improve the security of MySQL database from a network perspective. When connecting a MySQL database to the network, some special security issues arise. It's not a bad idea to create a user specifically for network connections. This will grant them the necessary, minimal permissions, thereby not granting the user permissions such as DROP, ALTER, or CREATE permissions. We might grant SELECT permission only in the type table and INSERT permission only in the order table. Additionally, this is an example of how to apply the principle of least privilege.

4. How to improve the loading speed of HTML pages

Summary and sharing on how to improve efficiency and safety

##Introduction: This article shares with you how to improve the page loading speed of HTML. It is very good and has reference loading. Friends who need it can refer to it

5.

Asp.net (2) Business processing interface project (Web Api)

Summary and sharing on how to improve efficiency and safety

Introduction: Introduction to Api as a business logic provider , carries the core logic of the project and therefore has relatively high logical complexity. Under such a premise, how to simplify code writing, how to standardize and unify the writing style and logic specifications, and how to improve the maintainability and scalability of the code. It becomes important to build projects with high cohesion and low coupling. The example is an enterprise-level project. The framework diagram is as follows. Security: Rewrites the Http request (Override DelegatingHandler), performs legality judgment on the aspects of the request, and preprocesses the signature requirements. ...

6.

Revealing the Google AMP project: How does Google amp improve web page loading speed?

Summary and sharing on how to improve efficiency and safety

Introduction: For AMP, there are two key points that affect user experience, that is JavaScript and JavaScript-based ads. The advantage of AMP lies in Google's powerful server, and the disadvantage lies in Google ads. Although it sounds ridiculous, advertising is indeed the disadvantage of AMP. Because Google has the largest online advertising server on the Internet

7. How does MySQL improve data paging efficiency

Summary and sharing on how to improve efficiency and safety

Introduction: PHP100 Chinese website is the first professional website in China that focuses on sharing PHP resources, and also provides a PHP Chinese communication community. For PHP learning researchers, it provides: the latest PHP information, original content, open source code, PHP video tutorials and other related content.

8. Sample code analysis on how to improve website front-end performance in HTML5

Summary and sharing on how to improve efficiency and safety

Introduction: 1. The biggest problem with replacing cookies with web storage is that they follow the request every time. In HTML5, sessionStorage and localStorage are used to store user data directly on the client, which can reduce the amount of data in HTTP requests. Moreover, Web storage also provides APIs to manipulate data, unlike cookies, which you have to write yourself. // if localStorage is present, use th

9. How to improve javascript loading speed

Summary and sharing on how to improve efficiency and safety

Introduction: This article mainly introduces the methods to improve the loading speed of javascript. It has a good reference value. Friends who need it can take a look together

10. C# Memory management of value types and reference types

Summary and sharing on how to improve efficiency and safety

Introduction: This time Log, let’s focus on how to improve performance during the software development process. This is a deep-seated problem in the software development or research and development process. This article mainly explains how calculations work in the process of writing our software code from two aspects: memory allocation and memory recycling. Here you can understand the process and methods of memory management so that you can pay attention to it and utilize it in future software development. Value types include: int, float, double, bool, structure, reference, variables representing object instances. Reference types include: classes and arrays; more special reference types...

[Related Q&A recommendations]:

How to improve the efficiency of sending emails in php

php Real-time price monitoring, the background database io is very large, and the calculation is very complicated Slow, how to solve it?

How PHP improves file query efficiency

javascript - How to improve js performance, prevent memory leaks, how to recycle memory, and DOM traversal What is reasonable

How to improve the speed of comparing a large number of strings

The above is the detailed content of Summary and sharing on how to improve efficiency and safety. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn