MySQL Full-text Search Workaround for innoDB tables

前端 未结 5 970
小鲜肉
小鲜肉 2020-12-05 01:15

I\'m designing an internal web application that uses MySQL as its backend database. The integrity of the data is crucial, so I am using the innoDB engine for i

5条回答
  •  Happy的楠姐
    2020-12-05 01:35

    You might be able to do some kind of data sync using triggers (if your version of mysql supports them). They allow you to run small snippets of SQL at certain points such as after data is inserted into or deleted from a table.

    For example...

    create trigger TRIGGER_NAME after insert on INNODB_TABLE
    insert into MYISAM_TABLE select * from INNODB_TABLE
    where id = last_insert_id();
    

    ... Whenever data is inserted into the INNODB table, the same data is automatically inserted into the MYISAM table.

提交回复
热议问题