patternsqlMinor
Slow insert with MySQL full-text index
Viewed 0 times
fullinsertwithtextslowmysqlindex
Problem
I use a full-text index in a MySQL table, and each insert into this table takes about 3 seconds. It seems that MySQL rebuilds (a part) of the full text index after each insert/update. Is this right?
The table has about 30
How can I get better performance from the
The table has about 30
varchar and text fields, some indexes on varchar-fields and a fulltext index over the three fields title_text (char(255)), content_text (text), author_text (char(255)). In the table are about 210.000 rows, the table size is about 2.5 GB and the index size about 0.5 GB. The insert queries are done for every new row (no combined query for all inserts).How can I get better performance from the
INSERT? Is there perhaps an option to set when MySQL rebuilds the full-text index?Solution
It must be as quick if not quicker to do:
ALTER TABLE mydb.datafulltxt DISABLE KEYS;
- Do many
INSERTs intomydb.datafulltxt
ALTER TABLE mydb.datafulltxt ENABLE KEYS;
- Repeat as required.
Context
StackExchange Database Administrators Q#27071, answer score: 2
Revisions (0)
No revisions yet.