1. 程式人生 > >mysql ocp 1z0-888 每日一題(5)

mysql ocp 1z0-888 每日一題(5)

10月5號

After analysis on the slow query log on a high-end OLTP service, the table identified in the slow
queries is:

 

What are the two most likely reasons for the slowness given this output?
A. The User field is too long for most names.
B. Date should be a TIMESTAMP field for better performance.
C. The engine type is not appropriate to the application use.
D. No indexes are defined.
E. Using default values for DATETIME causes table scans.

解析:

欄位名不長,不會影響效能的

timestamp的確比datatime少4位元組(只有4位元組),但是影響不大

如果是oltp系統,併發大的情況下不適用myisam引擎,因為寫入會阻塞讀操作,造成大量業務積壓

沒有索引可能會造成讀緩慢

使用預設值不會造成表掃描的
Answer: C,D