# T-SQL Queries

Published articles for T-SQL Queries.

This is one page of public article previews, not the complete archive. Follow Next page to continue. Summaries are not the original full articles.

## Dealing With Explosive sysjobhistory Growth

DevFeed: [Dealing With Explosive sysjobhistory Growth](<https://devfeed.tech/articles/dealing-with-explosive-sysjobhistory-growth-50494.md>)

Original publisher: [Read original article](<https://sqlperformance.com/2026/06/t-sql-queries/explosive-sysjobhistory-growth>)

Author: Aaron Bertrand

Published: 2026-06-24T17:21:26Z

Content type: article

Language: en

Sources: [SQLPerformance.com](<https://devfeed.tech/sources/sqlperformance-com.md>)

Topics: [sql-server](<https://devfeed.tech/topics/sql-server.md>), [SQL](<https://devfeed.tech/topics/sql.md>), [Database](<https://devfeed.tech/topics/database.md>)

Tags: [error-messages](<https://devfeed.tech/tags/error-messages.md>), [job](<https://devfeed.tech/tags/job.md>), [memory](<https://devfeed.tech/tags/memory.md>), [monitoring](<https://devfeed.tech/tags/monitoring.md>), [msdb](<https://devfeed.tech/tags/msdb.md>), [query](<https://devfeed.tech/tags/query.md>), [sql](<https://devfeed.tech/tags/sql.md>), [sql-indexes](<https://devfeed.tech/tags/sql-indexes.md>), [sql-performance](<https://devfeed.tech/tags/sql-performance.md>), [sql-plan](<https://devfeed.tech/tags/sql-plan.md>), [sql-server](<https://devfeed.tech/tags/sql-server.md>), [sysjobhistory](<https://devfeed.tech/tags/sysjobhistory.md>), [t-sql-queries](<https://devfeed.tech/tags/t-sql-queries.md>)

### AI overview

Aaron Bertrand investigates SQL Server memory exhaustion caused by a vendor query against sysjobhistory. The query lacked a suitable index, resulting in expensive scans, sorts, hash matches, and very large memory grants. He presents a more memory-efficient alternative and discusses temporary retention and cleanup measures.

### Source excerpt

Aaron Bertrand explains how he fixed a vendor query against sysjobhistory with memory grants so large that SQL Server would shut itself down. The post Dealing With Explosive sysjobhistory Growth appeared first on SQLPerformance.com.