Answer the question
In order to leave comments, you need to log in
Composite index Does the order in Where matter?
Let's say I create a table and index the columns in this order last_name, first_name, address
CREATE TABLE customer (
id INT NOT NULL,
last_name CHAR(30) NOT NULL,
first_name CHAR(30) NOT NULL,
address CHAR(30) NOT NULL,
PRIMARY KEY (id),
INDEX name (last_name,first_name,address)
);
"SELECT * FROM customer WHERE first_name = 'Joe' and last_name='Don'
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question