Setting up fast indices in MySQL
SUGGESTION #1 : Standard Indexing
CREATE TABLE mytable
(
id int not null auto_increment,
myfield varchar(255) not null,
primary key (id),
key (myfield)
);
If you index like this, you can either look for the whole string or do left-oriented LIKE searches
SUGGESTION #2 : FULLTEXT Indexing
CREATE TABLE mytable
(
id int not null auto_increment,
myfield varchar(255) not null,
primary key (id),
fulltext (myfield)
);
|