The following table is part of my project. I'm really strict about field types and store engines. I've read a lot of questions from this site, but I think there are a lot to do in the first step. Is there anything wrong with below fields and/or their relationship? Thanks in advance.
Based on the comments to your question, I would strongly recommend using InnoDB since it is ACID complaint and supports your foreign key layout.
When it comes to using InnoDB:
- Every working table needs to be InnoDB.
- You cannot use InnoDB in its Default setttings. You must tune its disk and memory settings.
- Every query doing JOINs cannot have a mixture of InnoDB and MyISAM or every SELECT query deteriorates with full tables locks : https://dba.stackexchange.com/a/9222/877
- You must give InnoDB a big enough Buffer Pool so data and index pages are cached : https://dba.stackexchange.com/a/2194/877
- You need to have InnoDB tables dwell in their own tablespace files or ibdata1 (default tablespace file) will grow out-of-control : https://dba.stackexchange.com/a/8983/877
As for the log table you have that uses the ARCHIVE storage engine, keep in mind
- ARCHIVE storage engine has no indexes
- Only INSERTs and SELECTs allowed
- All SELECTs are full table scans every time
As for SELECTs, you must tune the SELECTs to take proper advantage of table indexes. Otherwise, add the appropriate indexes to the tables.