Re: [phpodpworld-users] CREATE INDEX, text type and MySQL
Status: Beta
Brought to you by:
hansfn
From: Hans F. N. <Han...@hi...> - 2006-04-05 21:58:08
|
(I changed the subject since was inapropriate - telling nothing about the problem. Please use sensible subjects.) * Jason Yu <go...@gm...> [2006-04-03]: > I want to tell you another problem (I don't know it's my problem or the > program's). > In the db.sql file > --------------------------------------------- > CREATE TABLE "structure" ( > catid INT NOT NULL DEFAULT '0' PRIMARY KEY, > topic VARCHAR(1024) NOT NULL, /// Notice this line > title VARCHAR(1024), > description VARCHAR(8192), > lastupdate TIMESTAMP, > count INT DEFAULT '-1', > totalcount INT DEFAULT '-1' > ); > -------------------------------------------- > but in mysql the topic Field will be changed to text type automaticly. > so when go to : > > CREATE INDEX structure_topic_index ON structure (topic); > > it will be wrong . because text can't be maked to index. I'm using PostgreSQL on all my servers, so I can't really help you with MySQL problems. However, looking quickly at the MySQL documentation, I find You can add an index on a BLOB or TEXT column only if you are using the MyISAM, BDB, or InnoDB storage engine. Quoted from http://dev.mysql.com/doc/refman/5.0/en/create-index.html The file db.sql is not optimized for any DB and hence the storage engine is not given. You can play with this - try using MyISAM for example. Further questions about MySQL should be directed to a MySQL forum or newsgroup - for example http://forums.mysql.com/ http://groups.google.no/group/mailing.database.mysql http://groups.google.no/group/comp.databases Regards, Hans |