5

I used the following code to delete documents from RavenDB. At the bottom of Raven UI, I can see the number of documents decrease from 3,000,000 to 2,000,000. But the size of the "Data" file does not shrink down. It is always about 100G.

            store.DatabaseCommands.DeleteByIndex("Sagas/ByStarted", new IndexQuery
            {
                Query = "Started:{00010101000000 TO 20130101000000}",
            });

Server Build #960, Client Build #960 Please help ...

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Alex Chen
  • 53
  • 3

1 Answers1

4

That is by design. We don't give out space back to the OS by default. We keep and reuse that space again as needed. If you really need to trim the file size, you would need to compact the db, but that is an offline operation.

Ayende Rahien
  • 22,925
  • 1
  • 36
  • 41
  • Alex, it doesn't get any more official than this :) – Benjamin Gruenbaum Jun 23 '13 at 03:16
  • Sorry, one more question though. My hard drive only has 1G left. I guess I still need to compact the db, otherwise it will be difficult to tell when the "Data" file take up all the space right? – Alex Chen Jun 23 '13 at 03:41
  • In 960, you can compact using esentutl /d But I think that it needs to create temp files along the way, and 1GB may not be enough if you have 100GB db – Ayende Rahien Jun 23 '13 at 05:41