Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I add an index to a column that is datetime?

Tags:

database

mysql

Possible Duplicate
How does one create an index on the date part of DATETIME field in MySql

In mysql. It's a date column

like image 551
TIMEX Avatar asked Dec 07 '25 04:12

TIMEX


1 Answers

You do it in the same way as you would for any other column type:

CREATE INDEX IX_tblname_columnname
ON tbl_name (columnname)

See the documentation for more information and other options.

like image 133
Mark Byers Avatar answered Dec 08 '25 17:12

Mark Byers