Reputation: 881
Basically I have a lang
table with the columns pg VARCHAR(20)
,id VARCHAR(20)
,en (TEXT)
,ru (TEXT)
for my website's multilingual support and in 99.999% cases data will be read from the table instead of being written. I have heard that MyISAM performs better than InnoDB on read-oriented tables; should this table be MyISAM or InnoDB, considering that only the pg
column is used as a WHERE
clause?
Upvotes: 0
Views: 97
Reputation: 6606
Preface: I am no DBA.
I think the main advantage of MyISAM is that it will actually index on the fields you specify, rather than indexing each specified index to the mandatory auto-generated primary key id (a la InnoDB). The big advantage here is if you want to have indexes including multiple fields like a single index on (pg, en, ru), MyISAM can actually create that one index, rather than indexing each to id and doing three lookups as a slower equivalent.
In your case, if you only want to search on one field, you might get a modest performance boost from MyISAM since it will only have to look at that one field to retrieve your rows. InnoDB would get a list of ids from your field, then retrieve rows by id. Which is pretty much what it is optimized for anyway.
Without a clear advantage, I would do whatever is cleaner or easier. If you really want to know the answer, you might have to benchmark it.
Again, I'm no DBA, so maybe I'm way off on this!
Upvotes: 1