Does anyone know how to cleanup the oc_addressbookchanges tables?
For me it has grown in the past, some months to years ago. The current synctoken for principals/system/system is ~16.000.000. There are ~16.000.000 rows in oc_addressbookchanges consuming roundabout 1.2 Gigabytes. There are hundreds to thousands of rows for the same URI (matching: “LDAP:[name].vcf” for uri) with increasing synctoken values. That’s more than half of the whole DBMS size (incl. other databases not related to nextcloud).
I do not think they are all needed. There must be a way to clean all but the last for every single uri+addressbookid+operation value.
I don’t provide NC- or System-Versions here because it doesn’t matter. This is a leftover of the past, it happened anywhere between OC 7 and NC 13. Since some months, namely the NC 13 update last year, excessive growing has stopped. Maybe it’s some error with our ldap, maybe NC, maybe some NC Dav Backend, maybe the ldap server itself or a combination of all like the ldap config within NC. So… if there’s some way to cleanup oc_addressbookchanges we don’t need to dig further into the root cause of this; which probably doesn’t even rely to the NC at all.
The only answer I did find so far: “We let it grow forever. What problem are you running into?”
… still there’s no real problem with that. Nevertheless its size of more than a Gigabyte (more than all address books all together) seems quite unnecessary (way more metadata than real data).