Re: [sqlite] Reserve database pages

2010-08-13 Thread Dan Kennedy
On Aug 13, 2010, at 8:41 PM, Max Vlasov wrote: > On Fri, Aug 13, 2010 at 1:38 PM, Max Vlasov > wrote: > >> >> I can approximately calculate, how big the new database will grow. Is >>> there a way to tell SQLite to reserve an inital space or numer of >>> pages >>> instead of letting the datab

Re: [sqlite] Reserve database pages

2010-08-13 Thread Max Vlasov
On Fri, Aug 13, 2010 at 1:38 PM, Max Vlasov wrote: > > I can approximately calculate, how big the new database will grow. Is >> there a way to tell SQLite to reserve an inital space or numer of pages >> instead of letting the database file grow again and again? >> > > > Thought about this recentl

Re: [sqlite] Reserve database pages

2010-08-13 Thread Max Vlasov
> I can approximately calculate, how big the new database will grow. Is > there a way to tell SQLite to reserve an inital space or numer of pages > instead of letting the database file grow again and again? > Thought about this recently. Another idea is to tweak VFS. Since xWrite method is suppos

Re: [sqlite] Reserve database pages

2010-08-12 Thread Artur Reilin
> > On 12 Aug 2010, at 12:37pm, Pavel Ivanov wrote: > >>> Here I (or we) think of the cycles the system needs when the small >>> niche >>> of the initial database is exhausted and it has to look for another >>> free >>> block on the filesystem. If you can tell the system in advance, how big >>> th

Re: [sqlite] Reserve database pages

2010-08-12 Thread Simon Slavin
On 12 Aug 2010, at 12:37pm, Pavel Ivanov wrote: >> Here I (or we) think of the cycles the system needs when the small niche >> of the initial database is exhausted and it has to look for another free >> block on the filesystem. If you can tell the system in advance, how big >> the niche has to be

Re: [sqlite] Reserve database pages

2010-08-12 Thread emorras
TeDe escribió: > Hello, > > I want to import a big subset of data from one database to a new one. I > attach the two databases together and use > > insert into customers select * from source.customers where name LIKE 'x%' > > I can approximately calculate, how big the new database will grow. Is

Re: [sqlite] Reserve database pages

2010-08-12 Thread Pavel Ivanov
> The same with STL vectors: initializing it with a size is faster than > growing it element by element. That's pretty bad comparison. Initializing of vector with size is faster because it doesn't have to copy all elements later when it reallocates its memory. File system doesn't work that way, it

Re: [sqlite] Reserve database pages

2010-08-12 Thread TeDe
Am 12.08.2010 13:16, schrieb Martin.Engelschalk: > Am 12.08.2010 13:04, schrieb TeDe: >> Am 12.08.2010 12:16, schrieb Martin.Engelschalk: >>> Am 12.08.2010 12:08, schrieb TeDe: Hello, I want to import a big subset of data from one database to a new one. I attach the two da

Re: [sqlite] Reserve database pages

2010-08-12 Thread TeDe
Hello Pawel, you made some good points. I'm still in the stage of evaluation, I don't claim to know, its faster. But I saw that behavior on a filemanger: when you copy a large file, it immediately reseveres the whole space. The same with STL vectors: initializing it with a size is faster than gro

Re: [sqlite] Reserve database pages

2010-08-12 Thread Martin.Engelschalk
Am 12.08.2010 13:04, schrieb TeDe: > Am 12.08.2010 12:16, schrieb Martin.Engelschalk: >> Am 12.08.2010 12:08, schrieb TeDe: >>>Hello, >>> >>> I want to import a big subset of data from one database to a new one. I >>> attach the two databases together and use >>> >>> insert into customers se

Re: [sqlite] Reserve database pages

2010-08-12 Thread TeDe
Am 12.08.2010 12:16, schrieb Martin.Engelschalk: > > Am 12.08.2010 12:08, schrieb TeDe: >> Hello, >> >> I want to import a big subset of data from one database to a new one. I >> attach the two databases together and use >> >> insert into customers select * from source.customers where name LIKE

Re: [sqlite] Reserve database pages

2010-08-12 Thread Pavel Ivanov
k IO or CPU cycles if > it runs out of pages. > > --Original Message-- > From: Pavel Ivanov > Sender: sqlite-users-boun...@sqlite.org > To: General Discussion of SQLite Database > ReplyTo: General Discussion of SQLite Database > Subject: Re: [sqlite] Reserve database pages &

Re: [sqlite] Reserve database pages

2010-08-12 Thread Timothy A. Sawyer
Database ReplyTo: General Discussion of SQLite Database Subject: Re: [sqlite] Reserve database pages Sent: Aug 12, 2010 06:20 > I can approximately calculate, how big the new database will grow. Is > there a way to tell SQLite to reserve an inital space or numer of pages > instead of le

Re: [sqlite] Reserve database pages

2010-08-12 Thread Pavel Ivanov
> I can approximately calculate, how big the new database will grow. Is > there a way to tell SQLite to reserve an inital space or numer of pages > instead of letting the database file grow again and again? I'm looking > for a way to speed up the import. Why do you think that this kind of function

Re: [sqlite] Reserve database pages

2010-08-12 Thread Martin.Engelschalk
Am 12.08.2010 12:08, schrieb TeDe: > Hello, > > I want to import a big subset of data from one database to a new one. I > attach the two databases together and use > > insert into customers select * from source.customers where name LIKE 'x%' > > I can approximately calculate, how big the new da

[sqlite] Reserve database pages

2010-08-12 Thread TeDe
Hello, I want to import a big subset of data from one database to a new one. I attach the two databases together and use insert into customers select * from source.customers where name LIKE 'x%' I can approximately calculate, how big the new database will grow. Is there a way to tell SQLite to