Can you answer the following questions about MySQL accurately?
(1) What are the advantages of table locks compared to row locks?
(2) Is it better to use MyISAM or InnoDB for frequent group by business? Why?
MySQL > alter table write lock; alter table write lock; alter table write lock;
(4) A session releases the write lock on the table, N sessions need to write to the table, and M sessions need to read from the table. Which session gets the lock first? Why?
(5) how to judge whether table lock is the main conflict point?
(6) How to efficiently implement concurrent insertion and query, how to mutually exclusive?
(7) MyISAM when the data file will appear empty?
(8) MyISAM, if the data file has a void, should the newly inserted data fill the void first, or insert it at the end of the file?
…
But if you take a minute to read the insert Business, Which storage engine is better? , the above problems are small cases.
_ Voiceover: _ You can jump back to the original text to find out.
Judging from the comments, many students’ feedback is:
“… The article is too easy…”
“… MyISAM is outdated…”
…
After listening to everyone’s feedback, I felt sorry at first, thinking that I had wasted everyone’s time by talking about a topic that everyone knew very well.
However, judging from the comments on the problem set:
Not a single student answered correctly!!
Voiceover: You can skip back to the original text and read the comments. Unfortunately, I can’t send out any offers.
Of course, there may be friends who say, you are out of order, your answer is reliable? So, this time I’ll just post a screenshot from the MySQL website:
In general, table locks are superior to row locks in the following four cases:
…
These cases, with coarse-grained locks, are easier for applications to tune because the lock overhead is lower than row locking.
Voice-over: English is not good, the translation of the wrong we put forward.
Most of the time, we think we understand, in fact, do not understand thoroughly.
Most of the time, the idea is more important than the conclusion. MyISAM is indeed not the mainstream now, but the technical idea is also worth our learning.
The architect’s Path– Share technical ideas
Take a look at the first eight questions and the problem set to review the “Insert business, what storage engine is best for it?” I believe you will have a new harvest.
Research:
If you can answer all the eight questions correctly, you will lose 1.