U
U
user_of_toster2021-01-07 11:48:13
PostgreSQL
user_of_toster, 2021-01-07 11:48:13

Concatenated index from two columns === creating two indexes?

Do I understand correctly that creating a Concatenated index from two columns

CREATE INDEX index_name
ON table_name (column1, column2);

Equally
CREATE INDEX index_name1
ON table_name (column1);

CREATE INDEX index_name2
ON table_name (column2);

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Ezhgurov, 2021-01-07
@user_of_toster

In general, no. And in different DBMS differently. For example, in MySQL, an index (column1, column2) is also used to search only column1, but a separate index (column2) is required to search only column2.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question