Tutorial by Examples

Below are some tips to remember while we are writing a select query in MySQL that can help us and reduce our query time:- Whenever we use where in a large table we should make sure the column in where clause are index or not. Ex:- Select * from employee where user_id > 2000. user_id if ind...
In InnoDB, having a long PRIMARY KEY (either a single column with a lengthy value, or several columns that form a long composite value) wastes a lot of disk space. The primary key value for a row is duplicated in all the secondary index records that point to the same row. Create an AUTO_INCREME...
In many situations, a composite index performs better than an index with a single column. To build an optimal composite index, populate it with columns in this order. = column(s) from the WHERE clause first. (eg, INDEX(a,b,...) for WHERE a=12 AND b='xyz' ...) IN column(s); the optimizer may be...

Page 1 of 1