nhance your SQL Server expertise with these 30 MCQs on performance tuning basics. Covering query execution plans, statistics, index fragmentation, and optimization techniques, this guide ensures efficient query performance.
SHOW PLAN;EXECUTION PLAN;EXPLAIN;SET SHOWPLAN_XML ON;SAVE EXECUTION command.sqlplan.txtsys.execution_plansUPDATE STATISTICS command is runDBCC SHOWSTATISTICSDBCC CHECKTABLEDBCC CHECKSTATISTICSDBCC SQLSTATSUPDATE ALL STATISTICS;UPDATE STATISTICS ALL;EXEC sp_updatestats;DBCC UPDATESTATISTICS;DBCC SHOWSTATISTICSsys.dm_db_index_physical_statssp_helpindexALTER INDEX REBUILDUPDATE STATISTICSALTER INDEX ... REBUILD is performed?
FORCE INDEXUSE INDEXINDEXWITH (INDEX)OPTION (RECOMPILE) query hint do?
MAXDOP hint?
NOLOCK hintsFORCE ORDER hints| Qno | Answer |
|---|---|
| 1 | C) Steps SQL Server uses to execute a query |
| 2 | D) SET SHOWPLAN_XML ON; |
| 3 | B) A visual representation of query execution steps |
| 4 | B) Query may need optimization |
| 5 | B) Save it as .sqlplan |
| 6 | B) To optimize query performance |
| 7 | C) When a significant portion of data changes |
| 8 | A) DBCC SHOWSTATISTICS |
| 9 | B) It causes suboptimal query plans |
| 10 | C) EXEC sp_updatestats; |
| 11 | C) Physical and logical disorganization of index pages |
| 12 | B) Querying sys.dm_db_index_physical_stats |
| 13 | B) Using ALTER INDEX REBUILD |
| 14 | B) Between 5% and 30% fragmentation |
| 15 | B) The index is dropped and re-created |
| 16 | A) To enforce specific query execution options |
| 17 | D) WITH (INDEX) |
| 18 | A) Forces SQL Server to recompile the query plan for every execution |
| 19 | A) It limits the maximum degree of parallelism for a query |
| 20 | B) When SQL Server can generate efficient plans without intervention |
| 21 | D) Table Scan |
| 22 | D) Create appropriate indexes |
| 23 | B) It helps identify bottlenecks in query execution |
| 24 | A) Use NOLOCK hints |
| 25 | B) Database Engine Tuning Advisor (DTA) |