SQL Server 2022 Agent runs job to slow.

LiddellJim-7791 0 Reputation points
2024-08-23T18:05:44.4766667+00:00

I have a job that essentially does nothing and takes 13 seconds to run. But the Step only takes 1 sec.

The job set is using these TSQL commands.

set nocount on

select GETDATE() as before

I have job set to run every 10 seconds but according to job history.

User's image

Job takes 13 seconds and Step only take 1.

This makes no sense. There are other programs on the system using SQL but there is no apparent bottlenecks with system resources or SQL resources. No errors reported by SQL.

Any help would be appreciated.

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
13,690 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Erland Sommarskog 110.4K Reputation points MVP
    2024-08-23T21:02:44.66+00:00

    The explanation that come closest at hand is that some query/ies is in msdb is slow. You could enable Query Store. Not that you can do a lot to optimise in msdb, but there could be some history table(s) that could benefit from a purge. And a job that runs every ten seconds is likely to produce quite an amount of data.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.