Creating Index Using ALTER TABLE
Query:
ALTER TABLE sales ADD INDEX index_total (total_amount);
Output:
Explanation:
- We can also add indexes using ALTER TABLE statement.
- In this example we add an index on a column named total_amount.
Creating an index in MariaDB
MariaDB is an open–source and database management system. MariaDB is used for several purposes like as data warehousing, e-commerce, and logging applications. MariaDB is faster than MySQL in the replication and querying process. MariaDB supports invisible columns and temporary table space.
In this article, We will understand Creating an Index, the need for Indexing and creating various indexes for understanding, and so on.
It is useful to understand the MariaDB CREATE INDEX command. This boosts the speed of queries and makes databases work better, it increases query speed and improves database function.