Using DELAY_KEY_WRITE in MySQL: Should I Use It? Is there anything else I need to change?

I have a logging table that stores the user ID, date / time, table name, record ID, type of query (insert, update, delete, etc.) and the full SQL code that was run. There are a couple of keys on this table, but they do not need to be updated immediately. Typically, a table is used to check for problems (someone made a mistake or a system error has occurred) or for people to view changes made by people. But usually this is not done immediately after saving or they are performed only once a week or once a day.

Does DELAY_KEY_WRITEthe table include how this would be useful?

Is there anything else I need to include in MySQL or internally or add to my code? I was here where you need to use the launch option --myisam-recover. Is that the case?

+3
source share
1 answer

Perhaps, but why? If the entries here are generated by people typing (as it appears), you cannot overload a machine created after 1985 or so unless you use a netbook or your cell phone as a database server.

If you work closely enough to look at such things, I would suggest that you first do the profiling to see if there really were any problems. If you're not worried about performance, then what is the motivation for looking in DELAY_KEY_WRITE?

:

  • 1000 . "" ?
  • . ?
  • ? ?
  • ( , , ..)?
  • , . /?
+3

Source: https://habr.com/ru/post/1704944/


All Articles