3

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

In mysql. It's a date column

Community
  • 1
  • 1
TIMEX
  • 259,804
  • 351
  • 777
  • 1,080
  • Possible duplicate of [How does one create an index on the date part of DATETIME field in MySql](https://stackoverflow.com/questions/95183/how-does-one-create-an-index-on-the-date-part-of-datetime-field-in-mysql) – Cœur Jul 10 '18 at 13:20

1 Answers1

2

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.

Mark Byers
  • 811,555
  • 193
  • 1,581
  • 1,452
  • If I create this index on my master, will it get replicated over to my slave? – TIMEX Apr 02 '10 at 21:27
  • @alex: I have no idea, but you can check by running `SHOW CREATE TABLE tblname` on your slave and see if the index is present or not. – Mark Byers Apr 02 '10 at 21:43