[prev in list] [next in list] [prev in thread] [next in thread] 

List:       sqlite-users
Subject:    Re: [sqlite] SQLite - Database disk size difference when tables copied
From:       Richard Hipp <drh () sqlite ! org>
Date:       2012-08-23 13:22:29
Message-ID: CALwJ=Mz5K52Zwup4THsY+8bmrN+n6iyUoLaNdvDkTK2a3P08qA () mail ! gmail ! com
[Download RAW message or body]

On Thu, Aug 23, 2012 at 1:31 AM, Pavel Ivanov <paivanof@gmail.com> wrote:

> > When I implement the same mechanism for saving the
> > memory database back to disk, the size of disk file is 4x of the original
> > disk file size.
>
> What is "original disk file size" here? Is it an empty database,
> database with some data, database with exactly the same data you are
> restoring? If the latter then do you restore right over the existing
> data? If yes how?
>

Please get the "sqlite3_analyzer.exe" utility from the download
page<http://www.sqlite.org/download.html>and run it on your database
file both before and after the 4x size
increase.   Maybe send us the output of each run, if it isn't obvious where
the size increase is coming from.



>
> Pavel
>
>
> On Wed, Aug 22, 2012 at 10:00 PM, Madhur Kashyap
> <physiologoius@gmail.com> wrote:
> > Hello,
> >
> > I am using Tcl Extension (TEA) of SQLite inside an EDA tool which
> supports
> > TCL User Shell. I have a strange problem that SQLite version 3.7.10 is
> > downgraded to 3.5.9 when I load the necessary .so files. Due to this
> change
> > the backup and restore commands are probably causing a core dump in the
> EDA
> > tool execution.
> >
> > I have to implement save and restore capability for the memory database
> > used in the application. Restore I have implemented using traditional
> > method to first attach the disk database and then copy all tables listed
> in
> > sqlite_master table. When I implement the same mechanism for saving the
> > memory database back to disk, the size of disk file is 4x of the original
> > disk file size.
> >
> > What is the reason for this size increase? What can I do to avoid this
> file
> > size increase? A long pending question - Why the version is getting
> > downgraded to 3.5.9 ? The Tcl version is 8.4.x within the EDA tool. Also
> I
> > cannot find any SQLite libraries within the tool installation.
> >
> > dbcmd eval "ATTACH DATABASE 'test_disk.db' AS copyto"
> > set tableNames [ dbcmd eval {SELECT name FROM sqlite_master WHERE type
> > = 'table'} ]
> > foreach tname $tableNames {
> >     dbcmd eval "CREATE TABLE copyto.$tname AS SELECT * FROM $tname"
> > }
> >
> > --
> > Regards
> > Madhur Kashyap
> > _______________________________________________
> > sqlite-users mailing list
> > sqlite-users@sqlite.org
> > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>



-- 
D. Richard Hipp
drh@sqlite.org
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic