Answer the question
In order to leave comments, you need to log in
Composite indexing at the table, explain?
Good afternoon. I am working on the issue of indexing data in the table and due to a bunch of variations in the development of the event, I do not fully understand what indexes should be in different situations:
1.
2.
SELECT * FROM table_name WHERE col1 = 1;
SELECT * FROM table_name WHERE col1 = 1 AND col2 = 2;
SELECT * FROM table_name WHERE col1 = 1 AND col2 = 2 ORDER BY col3 ASC;
SELECT * FROM table_name WHERE col1 = 1 AND col2 = 2 ORDER BY col3 ASC, col4 DESC;
SELECT * FROM table_name WHERE col1 = 1 AND col2 = 1 AND col3 = 1 OR col4 = 1 ORDER BY col3 ASC, col4 DESC;
CREATE INDEX col1 ON table_name (col1);
Answer the question
In order to leave comments, you need to log in
8.3.1 How MySQL Uses Indexes
in online stores use different storage models or engines
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question