Re: [sqlite] size control of sqlite database

2010-01-14 Thread Martin Engelschalk
Hi Roger,

yes, thank you, i did not see this.

Martin

Roger Binns wrote:
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> Martin.Engelschalk wrote:
>   
>> However, i could not find a way to determine when the empty pages are
>> used up and the file will start to grow again without checking the file
>> size after every insert.
>> 
>
> Doesn't PRAGMA freelist_count help with that?  There is also PRAGMA
> page_count and another to determine page size so you can do all these
> calculations without going outside of SQLite.
>
> Roger
> -BEGIN PGP SIGNATURE-
> Version: GnuPG v1.4.9 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iEYEARECAAYFAktPZtwACgkQmOOfHg372QRHEgCeKwRMG+DpI1Kq/2jeo/Iw/DO0
> DtoAoIYIqt40E9TIWlebbYPta33S6o9r
> =pY6s
> -END PGP SIGNATURE-
> ___
> 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


Re: [sqlite] size control of sqlite database

2010-01-14 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Martin.Engelschalk wrote:
> However, i could not find a way to determine when the empty pages are
> used up and the file will start to grow again without checking the file
> size after every insert.

Doesn't PRAGMA freelist_count help with that?  There is also PRAGMA
page_count and another to determine page size so you can do all these
calculations without going outside of SQLite.

Roger
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAktPZtwACgkQmOOfHg372QRHEgCeKwRMG+DpI1Kq/2jeo/Iw/DO0
DtoAoIYIqt40E9TIWlebbYPta33S6o9r
=pY6s
-END PGP SIGNATURE-
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] size control of sqlite database

2010-01-14 Thread Martin.Engelschalk
Hi,

a sqlite database is a file, you can get its size using OS calls.
It is not possible to create a database with an initial size, because
the file grows dynamically when you insert data.

To avoid fragmentation, I also looked for a way to allocate empty space
inside the database file when creating it. Dr. Hipp proposed to create a
table with a single Blob-column, insert a very large, empty blob, and
then dropping the table. The file will then keep its size and afterwards
reuse the empty pages.
However, i could not find a way to determine when the empty pages are
used up and the file will start to grow again without checking the file
size after every insert.

Martin

gujx schrieb:
> Hi, I’d like to ask some question about the interface of the sqlite
> resource.
>
> Whether there is some interface to control the size of a database, for
> example, if I want to create a database with 5M initialized, how can I do
> that? And when I make change to a database, for example, insert a row to a
> table, then can I get the size of the database now?
>
>  
>
> Looking forward to your answer.
>
>  
>
>  
>
> Gu Jinxiang
>
>  
>
> 以上、よろしくお��いします。
>
>  
>
>   
> 
>
> ___
> 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


[sqlite] size control of sqlite database

2010-01-14 Thread gujx
Hi, I’d like to ask some question about the interface of the sqlite
resource.

Whether there is some interface to control the size of a database, for
example, if I want to create a database with 5M initialized, how can I do
that? And when I make change to a database, for example, insert a row to a
table, then can I get the size of the database now?

 

Looking forward to your answer.

 

 

Gu Jinxiang

 

以上、よろしくお��いします。

 

-- 

 

A new email address of FJWAN is launched from Apr.1 2007. 
The updated address is: g...@cn.fujitsu.com 

Development Dept.I
Nanjing Fujitsu Nanda Software Tech. Co., Ltd.(FNST) 8/F., Civil Defense
Building, No.189 Guangzhou Road, Nanjing, 210029, China
TEL:+86+25-86630566-619
COINS:79955-619 
FAX:+86+25-83317685
email:g...@cn.fujitsu.com 
-- 
This communication is for use by the intended recipient(s) only and may
contain information that is privileged, confidential and exempt from
disclosure under applicable law. If you are not an intended 
recipient of this communication, you are hereby notified that any
dissemination, distribution or copying hereof is strictly prohibited. If you
have received this communication in error, please notify me by 
reply e-mail, permanently delete this communication from your system, and
destroy any hard copies you may have printed. 

 

 

 

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users