Home >Database >Mysql Tutorial >What properties can speed up query operations?

What properties can speed up query operations?

藏色散人
藏色散人Original
2020-08-06 11:27:274593browse

The attribute that can speed up the query operation is "index". The index can be used to speed up the query and sorting of data. The index file is stored as an independent file. The file contains pointers to table records. Create an index. Afterwards, the physical order of the records in the table remains unchanged.

What properties can speed up query operations?

Recommended: "mysql video tutorial"

The attribute that can speed up query operations is "index" .

Using indexes can speed up the query and sorting of data. The index file is stored as an independent file. The file contains pointers to the table records. After the index is established, the physical order of the records in the table remains unchanged.

Related introduction:

In a relational database, an index is a separate, physical storage structure that sorts the values ​​of one or more columns in a database table. It is a collection of one or more column values ​​in a table and a corresponding list of logical pointers to data pages in the table that physically identify these values. The index is equivalent to the table of contents of a book. You can quickly find the required content based on the page numbers in the table of contents.

Indices provide pointers to data values ​​stored in specified columns of a table, and then sort these pointers according to the sort order you specify. The database uses an index to find a specific value and then points forward to find the row containing that value. This allows SQL statements corresponding to the table to execute faster and allows quick access to specific information in the database table.

When there are a large number of records in the table, if you want to query the table, the first way to search for information is to search the whole table, which is to take out all the records one by one, compare them one by one with the query conditions, and then return Records that meet the conditions will consume a lot of database system time and cause a lot of disk I/O operations; the second is to create an index in the table, then find the index value that meets the query conditions in the index, and finally save it in the index The ROWID (equivalent to the page number) in the table can quickly find the corresponding record in the table.

The above is the detailed content of What properties can speed up query operations?. 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