address.(3) Try to avoid null: The column should be specified as NOT NULL unless you want to store null. In MySQL, columns with null values are difficult to query optimization because they complicate indexing, index statistics, and comparison operations. You should use 0, a special value, or an empty string instead of a null value.This section is a few trivial suggestions and points for attention when it c
faster.(2) Simple data types are better: integer data is less expensive to handle than characters, because string comparisons are more complex. In MySQL, you should use a built-in date and time data type instead of a string to store the time, and an integer data type to store the IP address.(3) Try to avoid null: The column should be specified as NOT NULL unless you want to store null. In MySQL, columns with null values are difficult to query
block according to the pointer on the index block, so that the IO traffic is much less.
Second, index optimization technology
Is there an index that must be retrieved quickly? The answer is yes. Sometimes it's better to use indexes than to index faster. For example, we want to retrieve all the records in the above table, if not indexed, need access to 8,000 x1000 bytes/8k = 1000 pages, if you use the index, first retrieves the index, accesses 8,000 x
Label: index optimization, query optimization, query caching, Server Setup optimization, operating system and hardware optimization, application-level optimization (Web server, caching)
sufficient to prevent users from using your developed system.
I have analyzed this. The crux of this problem is so simple, but so important: the sorting field is not a clustered index!
The title of this article is "query optimization and paging algorithm solution ". The author does not put together the topics of "query optim
string, if not found, that must be traced back to the tail, speed is too slow to bear. Customers also have several fields set the criteria together to query, so basically twenty or thirty minutes will not come out, system availability is very poor.
My approach is to test the main, while looking at Java code, through log4j and perf4j logs, look at the time each SQL statement used, look for performance bottlenecks, and then targeted for
This article describes Oracle's query optimizer, a key component of the database, which gives Oracle users excellent performance. Oracle's query optimization technology is unmatched in functionality, and this article discusses all the important areas of query optimization in
Speaking of mysql, we immediately think of its small size, fast speed, and open source features, so it is widely used. Today, we will summarize the two most frequent mysql operations: insert and query, and the optimization methods.
Insert:
I. Text Import
Using load data infile to download DATA from text is 20 times faster than using the insert statement.
Example:
Load data local infile 'C:/Users/DELL/Deskt
query tree 22212.7 cut off a branch 22312.8 field List value de-weight 224The 13th chapter of the Application case Realization 22713.1 Extracting elements from a string from a fixed position 22713.2 Searching for alpha-numeric mixed strings 23013.3 grading results and converting to columns 23013.4 Importance of building the underlying data 23413.5 Returning data from different columns based on incoming criteria 23513.6 splitting a string to connect 2
Php+mysql Query Optimization Simple instance
This article mainly introduces the simple example of Php+mysql query optimization, analyzes the techniques of SQL statement optimization query in Php+mysql program design, and has some
normalCreate an indexALTER TABLE tabname Add index idxname (column)ALTER TABLE tabname add unique (column)ALTER TABLE TabName add primary key (column)Create INDEX Idxname on tabname (column)Create unique index idxname on tabname (name)Delete IndexDrop Index idxname on tabnameALTER TABLE tabname DROP INDEX IdxnameMySQL Slow query" %slow% " ; 2 | more than 2 seconds are defined as slow queries. | Slow_query_log | OFF | slow
index!
The title of this article is: "Query optimization and pagination algorithm scheme." The author only so that "query optimization" and "pagination algorithm" These two links are not very big topic together, because both need a very important thing--clustered index.
As we mentioned earlier in the discussion, clust
Tags: multiple table association between key words left JOIN best like inconsistent ATI driverTransferred from: http://blog.csdn.net/kevinlifeng/article/details/43233227 Statement is their own study is not original, hope everyone support the original. SQL statement optimization and indexing 1.Innerjoin and left connection, right connection, sub query A. Inner joins are also called equivalent connections, le
Tags: suitable for minimum hit use where to go Scale index desc execution planFirst, Introduction1. What is an index?General application system, reading and writing ratio of about 10:1, and the insertion operation and the general update operation rarely appear performance problems, in the production environment, we encounter the most, is also the most prone to problems, or some complex query operations, so the opt
MySQL query optimization: profile function. Note that you need to install the profile module.
MySQL query optimization: profile function. Note that you need to install the profile module.
MySQL query optimization: profile fun
explanation:
Qcache_free_memory
The amount of space currently remaining in the query cache.
Qcache_hits
The number of hits for the query cache.
Qcache_inserts
Number of query cache insertions
Qcache_free_blocks
How many remaining blocks are there at the moment? FLUSH
bytes;2. Data item: Whether there is a large number of paragraphs, the values of those fields are often updated;3. Data query SQL Condition: The column names of which data items often appear in the Where, GROUP by, and ORDER by clauses are medium;4. Data Update class SQL Condition: How many columns often appear in the WHERE clause of update or delete;5.SQL amount of statistical ratio, such as: select:update+delete:insert= how much?6. What is the magn
unfamiliar, specific usage and field meaning can refer to official website Explain-output, here need to emphasize rows is the core indicator, most of the rows small statement execution must be very fast (with exception, as described below). So the optimization statements are basically optimizing rows.Basic steps for slow query optimization0. Run first to see if it is really slow, note the setting Sql_no_ca
ArticleDirectory
Create highly selective Indexes
Create multi-column Indexes
Avoid creating indexes for small tables
Use indexes with filter clauses
Create an index for the order-by/group-by/distinct column to shorten the response time
Use Outer Join for restrictions
Optimize Indexes
Creating useful indexes is one of the most important ways to improve query performance. Useful indexes can help reduce the disk I/O
words, it is "No ACCESS database is faster ", this recognition is sufficient to prevent users from using your developed system.
I have analyzed this. The crux of this problem is so simple, but so important: the sorting field is not a clustered index!
The title of this article is "query optimization and paging algorithm solution ". The author does not put together the topics of "
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.