1

I have read the description of this command, but still don't know what it compresses, and why I should use it?

BTW: the subdirectory Data-NNN is for previous and current versions of the databases, which means it can only have 1000 versions of the database. But what would happen if it runs out numbers?

cygri
  • 9,412
  • 1
  • 25
  • 47
Gao
  • 912
  • 6
  • 16

1 Answers1

2

It does not run out of numbers, the name is variable length so it will spill to 5+ digits if needbe. It's 4 digits by the way - 1 to 9999.

tdbcompact create a new storage area which only contains the "in use" RDF data. TDB2 does not clear up all freed space as deletes happen, only some of the space - it is a trade-off of efficiency against needing to peform, for example, reference count literals and URIs actually used in the data.

Once migrated to a new storage area, the old area is not used at all. You can archive it, delete it, or file-compress it - whatever you want to do.

As a database is updated, it grows so occasionally compacting it and then deleting the old storage frees up persistent storage.

AndyS
  • 16,345
  • 17
  • 21