January 19, 2023 at 5:03 pm
Why would the version store be growing for a database where READ_COMMITTED_SNAPSHOT is OFF?
SELECT U.*,D.name,is_read_committed_snapshot_on
FROM tempdb.sys.dm_tran_version_store_space_usage U
JOIN sys.databases D on U.database_id = D.database_id
WHERE reserved_space_kb > 0
order by reserved_space_kb desc
Thanks
January 19, 2023 at 6:47 pm
Is ALLOW_SNAPSHOT_ISOLATION on?
January 19, 2023 at 7:29 pm
snapshot_isolation_state = 0 for all the databases listed above.
January 20, 2023 at 7:21 pm
Is this part of an availability group?
Jeffrey Williams
“We are all faced with a series of great opportunities brilliantly disguised as impossible situations.”
― Charles R. Swindoll
How to post questions to get better answers faster
Managing Transaction Logs
January 23, 2023 at 4:02 pm
Availability groups are not enabled on the server. Thanks.
January 24, 2023 at 8:56 pm
It turns out the virtual store is being used up by a trigger.
There's a nice explanation here: https://www.itprotoday.com/sql-server/triggers-and-version-store
My other mystery is why the virtual store space isn't necessarily freed up once the update/insert/delete has completed and a minute has passed for the system cleanup to run. It has to do with some other long-running transaction(s) but, as far as I know, they're not accessing the database with the trigger.
I've noticed this also with the virtual store and a database with READ_COMMITTED_SNAPSHOT where the space won't be freed up until some long-running transactions complete (again, I don't think they're accessing the database with the READ_COMMITTED_SNAPSHOT setting).
January 24, 2023 at 9:48 pm
The second scenario makes sense -- read-committed snapshot is going to maintain the version store until transaction is completed regardless of the isolation used by that transaction, because reads by other transactions under read-committed snapshot must still use the old version of data until the transaction completes.
I don't know what the expected lag is for cleanup.
January 24, 2023 at 9:55 pm
That is very interesting - learn something new every day. Thanks for the update.
Jeffrey Williams
“We are all faced with a series of great opportunities brilliantly disguised as impossible situations.”
― Charles R. Swindoll
How to post questions to get better answers faster
Managing Transaction Logs
January 25, 2023 at 10:52 am
tempdb version store is always used whenever snapshot isolation is used with any query or database !
Johan
Learn to play, play to learn !
Dont drive faster than your guardian angel can fly ...
but keeping both feet on the ground wont get you anywhere :w00t:
- How to post Performance Problems
- How to post data/code to get the best help[/url]
- How to prevent a sore throat after hours of presenting ppt
press F1 for solution, press shift+F1 for urgent solution 😀
Need a bit of Powershell? How about this
Who am I ? Sometimes this is me but most of the time this is me
Viewing 9 posts - 1 through 8 (of 8 total)
You must be logged in to reply to this topic. Login to reply