2

Hoping Laurion Burchall is listening :)

My database has a longbinary field that is used to temporarily cache some data. The data may not actually be needed for very long. Typical sizes range from 1k to 3MB

I've noticed the size of the database seems to grow without bound, even though at any point in time there is under 20 or 30MB of actual data that should be in the database.

The patten I'm using is

a) add the data with JetSetColumn, say 3MB
b) ... wait until the data is no longer need, often just a few hours - sometimes a little longer
c) when I want to delete the data, I'm (this could be wrong) using JetSetColumns passing a value of NULL. 

I would think the database would tend to be around 30MB or so, but instead it just gets bigger and bigger (30GB). Either the delete I'm doing isnt correct or I need to compact somehow?

I'm hoping someone would clearify what's happening, if I'm using ESE incorrectly, etc

stuck
  • 2,264
  • 2
  • 28
  • 62

1 Answers1

3

ESE doesn't reuse logically deleted/overwritten records until told to do so with JetDefragment or JetCompact

CoreyStup
  • 1,488
  • 13
  • 14
  • is there a way to have this be automatic? – stuck Jan 26 '11 at 07:08
  • You could just do it each time you're getting ready to insert your 3MB chunk of data. It would clean up after the last chunk of delete/update. – CoreyStup Jan 26 '11 at 16:17
  • my reading of JetCompact makes me think it'll copy the entire database? my DB is fairly large (1GB). I get the feeling I'm doing something incorrectly, just adding & deleting records shouldnt cause the DB to grow without bound should it? this seems weird – stuck Jan 28 '11 at 05:07
  • To be more precise: ESE will reuse space from logically deleted records but only JetCompact can reduce the size of the database. Your database growing problem is probably related to not setting the itagSequence in JetRetrieveColumns. – Laurion Burchall Jan 30 '11 at 22:52
  • hey Laurion, I'm not quite sure what you mean by the problem could be related to not setting the itagSequence? could you describe this a little more? – stuck Aug 23 '11 at 10:11
  • FWIW: I am not using a multivalued column – stuck Aug 23 '11 at 10:12