In SQLite and PosgreSQL, the VACUUM command rebuilds the entire database.
Questions tagged [vacuum]
232 questions
0
votes
1 answer
sqlite3 got syntax error while executing vacuum in a trigger
I'm using sqlte3.8.8, trying to create a trigger to clean old data. Here is the SQL that I put in:
CREATE TRIGGER "main"."NewTrigger" AFTER INSERT ON "historydata"
BEGIN
delete from historydata where id in (select id from historydata order by id…

joe
- 1,078
- 2
- 11
- 30
0
votes
1 answer
Postgres: Do we always need at least 3-4 times free the space of the biggest table?
we are using Postgres to store ~ 2.000.000.000 samples. This ends up in tables with ~ 500 mio entries and ~100GB Size each table.
What I want to do:
E.g. update the table entries: UPDATE table SET flag = true;
After this, the table is twice as big,…

hb0
- 3,350
- 3
- 30
- 48
0
votes
1 answer
AWS Redshift vacuum returns ERROR: Assert
Trying to vacuum a table in our Redshift cluster returns:
Error : ERROR: Assert
For other tables vacuum works just fine. The table is fairly large, but queries run against it seem to work.
Any idea how to get more info on what's wrong and trying to…

momnotmom
- 1
- 2
0
votes
1 answer
Does VACUUM FULL shrink row width after deleting a column?
According to the docs, after deleting rows in postgresql, they remain in a dead state, hence the need to periodically vacuum to reclaim this space. Does this also apply to row width when removing columns from tables, or is that space forever…

terpak
- 1,131
- 3
- 17
- 35
0
votes
0 answers
postgresql ignore index after vacuum
I have the following index:
CREATE INDEX in_table_1
ON table_1
USING btree
((COALESCE(col_1, 30001231::bigint)), col_2);
and the following select
select * from tabela_1
where coalesce(col_1, 30001231) >= 20150630 and col_1 <= 20150630
Im…
0
votes
1 answer
what is an optimal load path for Redshift?
in this blog
https://blogs.aws.amazon.com/bigdata/post/Tx2ANLN1PGELDJU/Best-Practices-for-Micro-Batch-Loading-on-Amazon-Redshift
I fail to see what is the main point of the load stream approach. Where does the saving come from? I understand about…

bhomass
- 3,414
- 8
- 45
- 75
0
votes
0 answers
SQLite vacuum before android auto backup
Android Auto Backup currently has a limit of 25 megabytes.
Is there any way to perform a SQLite vacuum on databases before backup manager runs the backup jobs?
The reason for this is to keep as many users as possible within the quota.

Jakob Eriksson
- 18,597
- 1
- 25
- 34
0
votes
1 answer
Is it necessary to vacuum a SQLite3 database to prevent data-loss?
In PostgreSQL it is necessary to vacuum periodically to prevent data loss of very old data due to transaction ID wraparound. I am concerned that data loss might be an issue with SQLite3 databases as well if they are not vacuumed…

Preetpal
- 172
- 7
0
votes
0 answers
Postgresql - avoid database shutdown + vacuum error
I have been receiving warning messages recently:
WARNING: database "mydb" must be vacuumed within xxxx transactions
HINT: To avoid a database shutdown, execute a full-database VACUUM in
"mydb".
So I have tryed VACUUM, VACUUM FULL and VACUUM…

ArKano
- 58
- 7
0
votes
0 answers
How do I wait for vacuum to complete?
I'm building a cache backed by a sqlite3 database. To limit disk space used, I'm periodically checking the size of the db file. If it's over my max limit, I batch delete the oldest items and vacuum, repeating until the size is below 80% of the…

OrangeDog
- 36,653
- 12
- 122
- 207
0
votes
1 answer
Postgres wraparound problems
I have facing one problem with my Production PostgreSQL and which is related to Wraparound Problem basically for over limit of XID range.
This PostgreSQL Production is running more than 1 year with loads of transaction and bulk insertion.
I…

Anvesh
- 7,103
- 3
- 45
- 43
0
votes
1 answer
android sqlite3 table vacuum not working
I need to reorder the rowid sequentially after deleting some rows. Vacuum on table seems to be a good fit for the situation but for some reasons its not reordering the rowid.
sqlite> .schema inboxmessages
CREATE TABLE InboxMessages(id text not…

Vihaan Verma
- 12,815
- 19
- 97
- 126
0
votes
2 answers
Avoid sqlite vacuum "database is locked" by application level retrying
I'm using a simple sqlite DB as persistent msg-queueing mechanism between processes. To reduce the file size after exceeding a certain limit I wanted to use the "vacuum" command. Generally all this works nicely, only that every now and then I get a…

tge
- 91
- 9
0
votes
1 answer
Whether indexing or autovacuum change the behavior of the query result?
I have a doubt regarding the result of a specific query.
SELECT final_copy,num_chars FROM table1 t1,table2 t2
WHERE t1.numid = t2.id
Getting two rows with this query,
final_copy | num_chars
------------+-----------------
1 | 1272
|…

RunningAdithya
- 1,656
- 2
- 16
- 22
0
votes
1 answer
Run postgres VACUUM inside celery task
I have celery periodic task that need to run postgres VACUUM query after each run, otherwise this task eats a lot of HDD space.
I tried to run VACUUM inside task at the end, but got error:
DatabaseError: VACUUM cannot run inside a transaction…

ramusus
- 7,789
- 5
- 38
- 45