#1 2013-08-27 16:35:38

dansot
Member
Registered: 2012-11-12
Posts: 25

sqlite database grows after 'VACUUM'

I have a database with ~1mil records.  If I delete 5000 entries and then 'VACUUM' it grows by 10MB.  Am I doing something wrong?

After the deletions are committed I am issuing:

database.EngineExecuteAll('VACUUM');

Thanks!

Offline

#2 2013-08-27 18:17:35

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,660
Website

Re: sqlite database grows after 'VACUUM'

Sounds weird to me.

Usually vacuum decreases the file size...

What is your "database" class type?
In some cases, vacuum is a no-op..

Offline

#3 2013-08-27 19:26:37

dansot
Member
Registered: 2012-11-12
Posts: 25

Re: sqlite database grows after 'VACUUM'

It's TSQLRestServerDB

Offline

#4 2013-08-27 20:31:20

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,660
Website

Re: sqlite database grows after 'VACUUM'

Use its internal db property.

But it is not possible if you use virtual tables....

Offline

#5 2013-08-27 21:13:28

dansot
Member
Registered: 2012-11-12
Posts: 25

Re: sqlite database grows after 'VACUUM'

ok, I used database.db.executeall('VACUUM') but it didn't have any effect.  I have two tables defined but I don't think they are virtual.

Last edited by dansot (2013-08-27 21:13:37)

Offline

#6 2013-08-28 11:11:22

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,660
Website

Re: sqlite database grows after 'VACUUM'

You can try database.db.Execute('VACUUM;');

Offline

#7 2013-08-28 14:34:43

dansot
Member
Registered: 2012-11-12
Posts: 25

Re: sqlite database grows after 'VACUUM'

That still adds 10MB to the file

Offline

#8 2013-08-28 15:41:54

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,660
Website

Re: sqlite database grows after 'VACUUM'

I do not understand it, honestly.
I've never seen such behavior.

Offline

Board footer

Powered by FluxBB