considerations on the type of tables used and on search functionality #34
Replies: 2 comments
-
Here's another consideration: MyISAM performs full table locking for update operations, whereas InnoDB performs row-level locking. This means that InnoDB has higher performance when multiple read and write operations are performed on the table, whereas MyISAM has higher performance when only reading from the table is required (it doesn't have to scan to check the row locks). |
Beta Was this translation helpful? Give feedback.
-
Considering the above observation, this would also mean that the requests log table for the current year (and for future years basically) should use the InnoDB storage engine, seeing they will be doing multiple read-write operations, whereas the requests log table for past years can be switched over to use the MyISAM storage engine, since no more write operations will be performed on them. |
Beta Was this translation helpful? Give feedback.
-
FULLTEXT SEARCH CAPABILITIES
Since fulltext search is an important aspect of this project, this needs to be taken into consideration. Before MySQL 5.6.4, only MyISAM databases had fulltext search capability, however ever since MySQL 5.6.4 (2011-12-20), InnoDB also has fulltext search capability. Some say to avoid using MyISAM for fulltext search now since it can get corrupted, and to prefer InnoDB.
(Solr is a search server for creating standard search applications, no massive indexing and no real time updates are required, but on the other hand Elasticsearch takes it to the next level with an architecture aimed at building modern real-time search applications. While Solr has traditionally been more geared toward text search, Elasticsearch is aiming to handle analytical types of queries.)
FOREIGN KEYS / INTERNAL RELATIONS
Seeing that it's not useful to keep the names of the books of the Bible in the tables that have the verse texts, as that would take up extra space unnecessarily, the tables are designed in such a way to have a separate table for the names of the books of the Bible in different languages alongside an identifying number which is used in the tables with the verse texts. Then a relationship needs to be defined in order to substitute that number with the name of the book.
CURRENT SITUATION
I believe that when I started the BibleGet project, InnoDB didn't yet support fulltext search, so I chose to use MyISAM tables. I have Fulltext search enabled and it seems to be working well, it's also quite fast. I haven't had any trouble with corruption of data but that could also be because no data is added to or removed from these tables, the tables are static and so the indexes are not updated. I have defined the "internal relationships" offered by PHPMyAdmin, which are easy enough to use (actually more intuitive than Foreign Key constraints in my opinion!).
Would there be any real advantage to switching from MyISAM to InnoDB? It's not like these tables need to be exported / imported very much. And even if it were, say to create a backup and restore, it's not like there are all that many relationships to restore, so doing it manually really wouldn't be all that difficult...
Beta Was this translation helpful? Give feedback.
All reactions