Does anyone know what (if anything) cleans up the Subscriber queue table? I am working on a Subscriber using PULL that gets the latest entries in the CDC Subscriber queue and that works fine, the OffSet is update to the latest and life is good. But the subscriber queue table appears to not be cleared after I do the pull. Will this live there for ever? Seems awfully wasteful to keep all this data in the qeue forever.
I thought there was a process to purge those- sorry this isn’t helpful Jose, but I swore when they were giving the insights presentation on this they had said there was a separate process.
When you look at your subscriber definition you will see to TTL entries: TTL and Read TTL (not looking at UI but you get the idea). TTL is ‘Time To Live’. I do not remember off the top of my head what the Scale is (seconds, minutes etc…) I’m sure the help likely says if the UI doesn’t’.
Anyway when the CDC Log Processor processes a chunk of records to see if there are any notifications at the end of that it run the following query:
So that is is doing is saying delete any queued notifications that exceed the TTLUnread column as well as any retrieved queued notifications that have exceeded the TTLRead value. So to see record removed from that table the CDC Log Processor task needs to be running, and then the TTL thresholds need to be exceeded.
I should note that on our Cloud deployments we have noticed that this triggers every 6 seconds which is WAY WAY too often for our poor cloud SQL servers that host hundreds of customers. So we are in the future going to reduce this cleanup to be immediately on start of the CDC Log Processor then every 10 minutes after that. No reason to be spamming SQL server for this.
this is a well timed question BTW I never would have beat Olga to the answer if she wasn’t on vacation