Commit 14f65ee
sp_QuickieStore: add clustered PKs to @find_high_impact temp tables
Adds clustered primary keys to 7 temp tables to give the optimizer
better cardinality and join strategy information:
- #hi_plan_stats (plan_id)
- #hi_query_stats (query_hash)
- #hi_interesting (query_hash)
- #hi_primary_window (query_hash)
- #hi_query_waits (query_hash)
- #hi_query_identifiers (query_hash)
- #hi_output (query_hash)
Tables without PKs are those with composite keys or multiple rows per
hash (staging tables, time_buckets, wait_staging, representative_text).
Tested on SQL2022 and SQL2016.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 0db8641 commit 14f65ee
1 file changed
Lines changed: 15 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3948 | 3948 | | |
3949 | 3949 | | |
3950 | 3950 | | |
3951 | | - | |
| 3951 | + | |
| 3952 | + | |
3952 | 3953 | | |
3953 | 3954 | | |
3954 | 3955 | | |
| |||
3971 | 3972 | | |
3972 | 3973 | | |
3973 | 3974 | | |
3974 | | - | |
| 3975 | + | |
| 3976 | + | |
3975 | 3977 | | |
3976 | 3978 | | |
3977 | 3979 | | |
| |||
4002 | 4004 | | |
4003 | 4005 | | |
4004 | 4006 | | |
| 4007 | + | |
4005 | 4008 | | |
4006 | 4009 | | |
4007 | 4010 | | |
| |||
4023 | 4026 | | |
4024 | 4027 | | |
4025 | 4028 | | |
4026 | | - | |
| 4029 | + | |
| 4030 | + | |
4027 | 4031 | | |
4028 | 4032 | | |
4029 | 4033 | | |
4030 | 4034 | | |
4031 | 4035 | | |
4032 | 4036 | | |
4033 | | - | |
| 4037 | + | |
| 4038 | + | |
4034 | 4039 | | |
4035 | 4040 | | |
4036 | 4041 | | |
| |||
4046 | 4051 | | |
4047 | 4052 | | |
4048 | 4053 | | |
4049 | | - | |
| 4054 | + | |
| 4055 | + | |
4050 | 4056 | | |
4051 | 4057 | | |
4052 | 4058 | | |
| |||
4080 | 4086 | | |
4081 | 4087 | | |
4082 | 4088 | | |
4083 | | - | |
| 4089 | + | |
| 4090 | + | |
4084 | 4091 | | |
4085 | 4092 | | |
4086 | 4093 | | |
| |||
4103 | 4110 | | |
4104 | 4111 | | |
4105 | 4112 | | |
| 4113 | + | |
4106 | 4114 | | |
4107 | 4115 | | |
4108 | 4116 | | |
| |||
4228 | 4236 | | |
4229 | 4237 | | |
4230 | 4238 | | |
4231 | | - | |
| 4239 | + | |
4232 | 4240 | | |
4233 | 4241 | | |
4234 | 4242 | | |
| |||
0 commit comments