Index: art/syntax/bubble-generator-data.tcl ================================================================== --- art/syntax/bubble-generator-data.tcl +++ art/syntax/bubble-generator-data.tcl @@ -488,11 +488,11 @@ qualified-table-name { line {optx /schema-name .} /table-name {or nil {line INDEXED BY /index-name} {line NOT INDEXED}} } vacuum-stmt { - line VACUUM + line VACUUM {optx /schema-name} } comment-syntax { or {line -- {loop nil /anything-except-newline} {or /newline /end-of-input}} Index: art/syntax/vacuum-stmt.gif ================================================================== --- art/syntax/vacuum-stmt.gif +++ art/syntax/vacuum-stmt.gif cannot compute difference between binary files Index: pages/lang.in ================================================================== --- pages/lang.in +++ pages/lang.in @@ -4516,11 +4516,12 @@ RecursiveBubbleDiagram vacuum-stmt

- The VACUUM command rebuilds the entire database. There are several + The VACUUM command rebuilds an entire database, packing the content as + tightly as possible. There are several reasons an application might do this:

-

^(VACUUM only works on the main database. It is not possible to VACUUM an -attached database file.)^ +

On all versions of SQLite through [version 3.14.1], +the VACUUM command only worked on the main database schema. +The optional schema-name argument was +accepted by silently ignored. Beginning with SQLite [version 3.15.0], +any database other than TEMP can be vacuumed by providing its +schema-name as an argument. If the argument is +omitted, the default is "main". The schema-name argument is the +name following the AS keyword in the [ATTACH] statement, not the +name of the database file.

^The VACUUM command works by copying the contents of the database into a temporary database file and then overwriting the original with the contents of the temporary file. ^When overwriting the original, a rollback journal or [write-ahead log] WAL file is used just as it would be for any @@ -4558,23 +4566,31 @@

^The VACUUM command may change the [ROWID | ROWIDs] of entries in any tables that do not have an explicit [INTEGER PRIMARY KEY].

-

^A VACUUM will fail if there is an open transaction, or if there are one or -more active SQL statements when it is run.

^(As of SQLite version 3.1, an alternative to using the VACUUM command to reclaim space after data has been deleted is auto-vacuum mode, enabled using the [auto_vacuum] pragma.)^ ^When [auto_vacuum] is enabled for a database free pages may be reclaimed after deleting data, causing the file to shrink, without rebuilding the entire database using VACUUM. However, using [auto_vacuum] can lead to extra database file fragmentation. And [auto_vacuum] does not compact partially filled pages of the database as VACUUM does. -

+

Restrictions

+ +

^A VACUUM will fail if there is an open transaction, or if there are one or +more active SQL statements when it is run. + +

^The VACUUM command will fail with an obscure error if the +[database connection] contains any [ATTACH]-ed database whose +schema-name is "vacuum_db". This is due to the fact that the +VACUUM command [ATTACH]-es a temporary table named "vacuum_db" +as part of its processing. + ############################################################################## Section {INDEXED BY} indexedby {{INDEXED BY} {NOT INDEXED}}