2.Youwanttostartmonitoringstatisticsonthedistributionofstorageenginesthatare
beingusedandtheaveragesizesoftablesinthevariousdatabases.Somedetailsareas
follows:
TheMySQLinstancehas400databases.
Eachdatabaseonanaverageconsistsof25-50tables.Youusethequery:
SELECTTABLE_SCHEMA,
`ENGINE`,COUNT(*),
SUM(data_length)total_size
FROMINFORMATION_SCHEMA.TABLES
WHERETABLE_TYPE='BASETABLE'
GROUPBYTABLE_SCHEMA,ENGINE;
Whyisthisqueryslowtoexecute?
A.CountingandsummarizingalltablepagesintheInnoDBsharedtablespaceistime
consuming.
B.Collectinginformationrequiresvariousdisk-leveloperationsandistimeconsuming.
C.Aggregatingdetailsfromvariousstorageenginecachesforthefinaloutputistime
consuming.
D.Collectinginformationrequireslargenumbersoflocksonvarious
INFORMATION_SCHEMAtables,therebycausingcontention.
3.Adatabaseexistsasaread-intensiveserverthatisoperatingwithquery_cache_type=
DEMAND.Thedatasetisrefreshedperiodically,buttheresultsetsizeofthequeriesdoesnot
fluctuate.Notethefollowingdetailsaboutthisenvironment:
Awebapplicationusesalimitedsetofqueries.
TheQueryCachehitrateishigh.
AllresultsetsfitintotheQueryCache.
AllqueriesareconfiguredtousetheQueryCachesuccessfully.Theresponsetimesfor
querieshaverecentlystartedtoIncrease.Thecauseforthishascorrectlybeenidentified
astheincreaseinthenumberofconcurrentusersaccessingthewebservice.
Basedsolelyontheinformationprovided,whatisthemostlikelycauseforthis
slowdownatthedatabaselevel?
A.TheQueryCacheIspruningqueriesduetoanIncreasednumberofrequests.
B.query_cache_min_res_unithasbeenexceeded,leadingtoanincreasedperformance
overheadduetoadditionalmemoryblocklookups.
评论