Go [Dapper] Parameterized query slow

Source: Internet
Author: User

Reference: https://www.cnblogs.com/wy123/p/7190785.html Reference: https://www.cnblogs.com/Irving/p/3951220.html
if object_id('tempdb: #t_remove_expired_plan') is  not NULL    Drop Table#t_remove_expired_planGOCreate Table#t_remove_expired_plan (IDint Identity(1,1), Plan_handlevarbinary( -))GOInsert  into#t_remove_expired_plan (plan_handle)SelectQs.plan_handle fromsys.dm_exec_query_stats QSwhereCreation_time< DateAdd(HH,- -,getdate())GODeclare @exists_data bit = 1Declare @v_plan_handle varbinary( -)Declare @str_sql varchar( +) while @exists_data = 1begin    Select Top 1 @v_plan_handle =Plan_handle from#t_remove_expired_planif(@v_plan_handle  is  not NULL)    begin        Executesp_executesql N'DBCC Freeproccache (@plan_handle)'N'@plan_handle varbinary ($)',@plan_handle = @v_plan_handle    End    Delete Top(1) from#t_remove_expired_planif exists(Select 1  from#t_remove_expired_plan)begin        Set @exists_data = 1    End    Else     begin        Set @exists_data = 0    EndEnd

Reference: https://www.cnblogs.com/quanweiru/p/5577421.html

Go [Dapper] Parameterized query slow

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.