Here I'll show how we can speed up our Mysql Queries using MySQL indexes. We'll convert queries that take over 2 Seconds to under 3 Milli Seconds.
Create Index: dev.mysql.com/...
Drop Index: dev.mysql.com/...
Create table: dev.mysql.com/...
Alter Table: dev.mysql.com/...
Mysql Indexes allow us tell Mysql databases to index specific columns. This works similar to how regular indexes work in books. Similarly, when DB tables are indexed, Mysql searches in the index column to return the data. This is faster since it does not crawl through each row, but instead uses binary search to get the results. Mysql by default uses B-Tree index on all indexed columns.
In this Mysql Index Tutorial, we will create index on a table with close to 3 million records. We will use index on single column and on multiple columns and see the time differences. Here we will also how Mysql Indexes work and how Binary search concept is used in the Mysql Index.
SUBSCRIBE: / @technotrax
26 сен 2024