[MSSQL] 쿼리스토어 활용 쿼리(호출 시간, 플랜 등 확인)
요즘 SP를 가급적 사용하지 않는 추세이긴 하지만 우리 회사는 대부분의 쿼리들을 SP로 호출하는 중으로 SP에 대한 모니터링 요소가 많다. 그중 하나로 SP 최초 실행, 마지막 컴파일, 마지막 실행 등을 확인할 필요가 있어서 아래의 쿼리로 확인을 한다. select qsq.query_id ,qsp.plan_id ,qsq.object_id ,qst.query_sql_text ,convertedplan = try_convert(XML,qsp.query_plan) ,qsq.last_compile_memory_kb ,qsp.initial_compile_start_time ,qsp.last_compile_start_time ,qsp.last_execution_time from sys.query_store_quer..
2022. 12. 5.