The basic syntax is as follows −Ī composite index is an index on two or more columns of a table. A unique index does not allow any duplicate values to be inserted into the table. Unique indexes are used not only for performance, but also for data integrity. The CREATE INDEX Commandįollowing is the basic syntax of CREATE INDEX.Ī single-column index is one that is created based on only one table column. Indexes can also be unique, similar to the UNIQUE constraint, in that the index prevents duplicate entries in the column or combination of columns on which there's an index.
Indexes can be created or dropped with no effect on the data.Ĭreating an index involves the CREATE INDEX statement, which allows you to name the index, to specify the table and which column or columns to index, and to indicate whether the index is in an ascending or descending order.
#Sqlite browser filter update
An index in a database is very similar to an index in the back of a book.įor example, if you want to reference all pages in a book that discuss a certain topic, you first refer to the index, which lists all topics alphabetically and are then referred to one or more specific page numbers.Īn index helps speed up SELECT queries and WHERE clauses, but it slows down data input, with UPDATE and INSERT statements. Simply put, an index is a pointer to data in a table.
Indexes are special lookup tables that the database search engine can use to speed up data retrieval.