Skip to content

Commit

Permalink
Add OPTION RECOMPILE for perf reasons due to temp table (influxdata#7242
Browse files Browse the repository at this point in the history
)
  • Loading branch information
denzilribeiro authored Mar 31, 2020
1 parent 8ff2645 commit ccefc42
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion plugins/inputs/sqlserver/sqlserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -790,7 +790,8 @@ FROM @PCounters AS pc
AND pc.object_name = pc1.object_name
AND pc.instance_name = pc1.instance_name
AND pc1.counter_name LIKE '%base'
WHERE pc.counter_name NOT LIKE '% base';
WHERE pc.counter_name NOT LIKE '% base'
OPTION(RECOMPILE);
`

// Conditional check based on Azure SQL DB v/s the rest aka (Azure SQL Managed instance OR On-prem SQL Server)
Expand Down

0 comments on commit ccefc42

Please sign in to comment.