Well I was able to clean alot of old Jobs that were obsolete. Most tables now are much smaller and everything is still working. But I see still 20 GB data in the table set.
From my understanding, when I now select them by…
SELECT CAST(SUBSTRING([Key], 19, LEN([Key]) - 19) AS int) as SetJobId, *
FROM [HangFire].[Set]
WHERE [Key] LIKE ‘console:%’
I would get the referening jobids. As a result I find 3801 distinct jobids. When I now join them with the Job table I see that only 2 jobids do exists. BTW: These jobsids were also not part of the Jobs I deleted before.
This would mean that 8.7 millions records in the table Set do refer to a Job that doesnt exist anymore.
So my question is: Is the query above really selecting the jobids in the set table correctly?
And if yes: Then I am able to delete these entries. Right?
And: Is there any db reference guide for this db? I looked into the source but didnt find any code that would add console records for this. From my understanding the table Set includes all the console Output that can be seen in the webapp. We dont need them since we are saving console output of our jobs/scripts in an own table.