MySql Indexing A database index is a data structure that improves the speed of operations in a table.INSERT and UPDATE statements take more time on tables having indexes where as SELECT statements become fast on those tables. The reason is that while doing insert or update, database need to insert or update index values as well. Indexes are a way to avoid scanning the full table to obtain the result CREATE TABLE person ( last_name VARCHAR(50) NOT NULL, first_name VARCHAR(50) NOT NULL, INDEX (last_name, first_name) ); So if your index has two columns, say last_name and first_name, the order that you query these fields matters a lot. This query would take advantage of the index: SELECT last_name, first_name FROM person WHERE last_name = "John" AND first_name LIKE "J%" Using Create statement CREATE INDEX techsudhir_age ON employees(emp_name, emp_age); Alter command to update index ALTER TABLE person ADD INDEX (name); Removing Indexes DROP...
Coding Cheatsheets - Learn web development code and tutorials for Software developers which will helps you in project. Get help on JavaScript, PHP, XML, and more.