I created a simple index associated with a timestamp column
CREATE TABLE `data` (
`id` INT(11) UNSIGNED NOT NULL,
`ticker` VARCHAR(16) NOT NULL COLLATE 'utf8_unicode_ci',
`comment` TEXT NOT NULL COLLATE 'utf8_unicode_ci',
`link` VARCHAR(256) NULL DEFAULT NULL COLLATE 'utf8_unicode_ci',
`comment_hash` CHAR(32) NOT NULL COLLATE 'utf8_unicode_ci',
`time` DATETIME NOT NULL,
`feed` VARCHAR(16) NOT NULL COLLATE 'utf8_unicode_ci',
`source` INT(11) NOT NULL,
`active` TINYINT(1) NOT NULL DEFAULT '1',
`score` VARCHAR(20) NULL DEFAULT NULL COLLATE 'utf8_unicode_ci',
`dttm` DATETIME NULL DEFAULT NULL,
PRIMARY KEY (`ticker`, `comment_hash`),
INDEX `time_index1` (`time`)
)
COLLATE='utf8_unicode_ci'
ENGINE=InnoDB;
However when I try to do anything with the index, it gives me SQL Error (1054): Unknown column 'time_index1' in 'where clause'
Sample queries:
select *
from data
where time_index1 = '2013-10-01 17:18:06'
or
select *
from data
order by time_index1