Skip to content

Commit

Permalink
Merge pull request erikdarlingdata#438 from erikdarlingdata/dev
Browse files Browse the repository at this point in the history
Update sp_QuickieStore.sql
  • Loading branch information
erikdarlingdata authored May 26, 2024
2 parents 50aa85e + d47ba06 commit c56edc7
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions sp_QuickieStore/sp_QuickieStore.sql
Original file line number Diff line number Diff line change
Expand Up @@ -624,6 +624,15 @@ CREATE TABLE
plan_id bigint PRIMARY KEY
);

/*
Hold plan_ids for matching query text (not)
*/
CREATE TABLE
#query_text_search_not
(
plan_id bigint PRIMARY KEY
);

/*
Hold plan_ids for matching wait filter
*/
Expand Down Expand Up @@ -1420,13 +1429,15 @@ SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;',
@where_clause = N'',
@query_text_search =
CASE
WHEN @get_all_databases = 1 AND @escape_brackets = 1
WHEN @get_all_databases = 1
AND @escape_brackets = 1
THEN @query_text_search_original_value
ELSE @query_text_search
END,
@query_text_search_not =
CASE
WHEN @get_all_databases = 1 AND @escape_brackets = 1
WHEN @get_all_databases = 1
AND @escape_brackets = 1
THEN @query_text_search_not_original_value
ELSE @query_text_search_not
END,
Expand Down Expand Up @@ -4136,7 +4147,7 @@ BEGIN
END;

SELECT
@current_table = 'inserting #query_text_search',
@current_table = 'inserting #query_text_search_not',
@sql = @isolation_level;

IF @troubleshoot_performance = 1
Expand Down Expand Up @@ -4212,7 +4223,7 @@ END;
END;

INSERT
#query_text_search WITH(TABLOCK)
#query_text_search_not WITH(TABLOCK)
(
plan_id
)
Expand Down Expand Up @@ -4243,7 +4254,7 @@ END;
(
SELECT
1/0
FROM #query_text_search AS qst
FROM #query_text_search_not AS qst
WHERE qst.plan_id = qsrs.plan_id
)' + @nc10;
END;
Expand Down

0 comments on commit c56edc7

Please sign in to comment.