What is an index in SQL?

后端 未结 11 2327
粉色の甜心
粉色の甜心 2020-11-22 11:01

What is an index in SQL? Can you explain or reference to understand clearly?

Where should I use an index?

11条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-11-22 11:21

    Indexes are all about finding data quickly.

    Indexes in a database are analogous to indexes that you find in a book. If a book has an index, and I ask you to find a chapter in that book, you can quickly find that with the help of the index. On the other hand, if the book does not have an index, you will have to spend more time looking for the chapter by looking at every page from the start to the end of the book.

    In a similar fashion, indexes in a database can help queries find data quickly. If you are new to indexes, the following videos, can be very useful. In fact, I have learned a lot from them.

    Index Basics
    Clustered and Non-Clustered Indexes
    Unique and Non-Unique Indexes
    Advantages and disadvantages of indexes

提交回复
热议问题