What should I use?

Hi all, please tell me:
1) what is the best use for the aggregator ads, MyISAM or InnoDB
2) watching two base opencart and wordpress, opencart see written on MyISAM, and InnoDB on WP, it is clear that MyISAM has no foreign keys and opencart did not use them, and why in WP no external links?
3) and a General question if you choose InnoDB you need to use foreign keys?, again look at WP and do not see it outside, but instead of keys there are used the indexes as better?
I would be grateful for any advice!)
June 8th 19 at 17:23
2 answers
June 8th 19 at 17:25
Solution
standard question.

it all depends on the ratio of the number of select operations with a number of operations update/insert/delete.

you can even make graphs of the dependence of the average time of fetching from the table size and the ratio of the number of types of operations
whether any(!) select wait for any(!) insert/update? if Yes, then myIsam, no - innoDb + bypass the inevitable lock - maritza_Marquardt commented on June 8th 19 at 17:34
when about to compare, it will be about 2-3 (update/insert/delete) to 10 (select), and in this case it is better to choose myisam + indexes and it will be good, am I right?) - watson_Lowe81 commented on June 8th 19 at 17:37
no. if this ratio, you will have to bypass Locke on innodb engine. and that's the biggest curse of the muscle - maritza_Marquardt commented on June 8th 19 at 17:40
the highest priority should be select, and then insert - > update - watson_Lowe81 commented on June 8th 19 at 17:28
depends on the number, not priority. in myisam, any insert will be forced to wait any select, but if it is to get around using innodb, then the rate will fall - maritza_Marquardt commented on June 8th 19 at 17:31
realized and 2 or 3 something to tell me?, for foreign keys - watson_Lowe81 commented on June 8th 19 at 17:43
, 2-3 the question is worded wrong. foreign key and index it's sooo different things. it is minus the muscle that he creates an index on the field referenced by external FK. ie it needs to be there, of course, but not accessible from the outside - maritza_Marquardt commented on June 8th 19 at 17:46
thanks - watson_Lowe81 commented on June 8th 19 at 17:49
June 8th 19 at 17:27
Solution
If in doubt, use InnoDB and foreign keys (not necessarily, but in most cases is desirable).
ie you can choose InnoDB + foreign keys + indexes and all?) - watson_Lowe81 commented on June 8th 19 at 17:30
A foreign key guarantees data consistency, but requires a little extra time when you insert/update.
The index is usually much faster select, but slightly slows down insert/update/delete.

That is, usually they're good, but still need to think a head, when they should or should not apply. - maritza_Marquardt commented on June 8th 19 at 17:33
understood thank you - maritza_Marquardt commented on June 8th 19 at 17:36
FK in the muscle when you join smash Locco for all related tables, even if they are not explicitly in the update/insert. to circumvent Locke best and only (holivar) is the correct option to write in one table and read from another - watson_Lowe81 commented on June 8th 19 at 17:39
I mean when once a period of time, which varies by the minute, obsolete data volume multiple M - maritza_Marquardt commented on June 8th 19 at 17:42

Find more questions by tags MySQL