Index creation, advantages and disadvantages

Source: Internet
Author: User

Create an index (basic conditions. For other constraints, see query ):

Create [index type] Index name on table name (column name)

Advantages:

  • First, you can create a unique index to ensure the uniqueness of each row of data in the database table.
  • Second, it can greatly speed up data retrieval, which is also the main reason for creating an index.
  • Third, it can accelerate the connection between tables, especially in achieving Data Reference integrity.
  • Fourth, when you use grouping and sorting clauses to retrieve data, you can also significantly reduce the time for grouping and sorting in queries.
  • Fifth, by using indexes, you can use the optimizer during the query process to improve system performance.

Disadvantages:

  • First, it takes time to create and maintain indexes. This time increases with the increase of data volume.
  • Second, indexes occupy physical space. In addition to data tables, each index occupies a certain amount of physical space. To create a clustered index, the required space is larger.
  • Third, when adding, deleting, and modifying data in the table, the index must also be dynamically maintained, which reduces the Data Maintenance speed.

Index creation, advantages and disadvantages

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.