Re: [sqlite] insert speeds slowing down as database size increases (newb)

2008-10-31 Thread John Stanton
You canot have constant time inserts into a B-Tree because of the inherent nature of the algorithm. Berkeley DB has either B-Tree or hashed indices. The unordered hashed indices are possibly what you measured. Note that B-Trees have the additional property that they maintain an order and

Re: [sqlite] insert speeds slowing down as database size increases (newb)

2008-10-30 Thread Julian Bui
Unless I did something wrong, I did observe constant time inserts in Berkeley DB. Is it possible that I had constant time inserts into a btree as my db grew because of the nature of my data? I was inserting records in order of how they would be sorted by index. In other words, every inserted

Re: [sqlite] insert speeds slowing down as database size increases (newb)

2008-10-30 Thread Alex Scotti
On Oct 29, 2008, at 4:59 AM, Julian Bui wrote: > Hi everyone, > > First off, I'm a database and sqlite newbie. I'm inserting many many > records and indexing over one of the double attributes. I am seeing > my insert times slowly degrade as the database grows in size until > it's unacceptable

Re: [sqlite] insert speeds slowing down as database size increases (newb)

2008-10-29 Thread Julian Bui
> > See "PRAGMA cache_size". If you're working on a modern desktop with > a comfortable amount of RAM, it isn't unreasonable to increase the > cache size by an order of magnitude or two (default is 2000). > I forgot to mention I use JDBC to access sqlite from a java app. Is there an

Re: [sqlite] insert speeds slowing down as database size increases (newb)

2008-10-29 Thread Julian Bui
Thanks for replies everyone. Actually, I don't include the code but I do make a very small mention of using batch inserts w/ a transaction ("> //every dataInsertPs gets added to a batch and committed every 1000 records"). I am using JDBC so I do not use BEGIN and END statements. Do I need to

Re: [sqlite] insert speeds slowing down as database size increases (newb)

2008-10-29 Thread Jay A. Kreibich
On Wed, Oct 29, 2008 at 06:10:56AM -0600, John Stanton scratched on the wall: > The Sqlite B-Tree indices do slow down on insertion as extra levels are > created in the index as it grows large. That is an inherent feature of > such structures. This can often be mitigated by increasing the

Re: [sqlite] insert speeds slowing down as database size increases( newb)

2008-10-29 Thread John Elrick
Eduardo Morras wrote: > At 13:10 29/10/2008, you wrote: > >> Look up the implications of Sqlite's ACID feature and the use of >> transactions. COMMITs are tied to disk rotation speed. On our Sqlite >> databases where we look for performance we use 15,000 rpm disks and are >> diligent in

Re: [sqlite] insert speeds slowing down as database size increases (newb)

2008-10-29 Thread Eduardo Morras
At 13:10 29/10/2008, you wrote: >Look up the implications of Sqlite's ACID feature and the use of >transactions. COMMITs are tied to disk rotation speed. On our Sqlite >databases where we look for performance we use 15,000 rpm disks and are >diligent in wrapping INSERTs, UPDATEs and DELETEs in

Re: [sqlite] insert speeds slowing down as database size increases (newb)

2008-10-29 Thread John Stanton
Look up the implications of Sqlite's ACID feature and the use of transactions. COMMITs are tied to disk rotation speed. On our Sqlite databases where we look for performance we use 15,000 rpm disks and are diligent in wrapping INSERTs, UPDATEs and DELETEs in transactions and get very good

Re: [sqlite] insert speeds slowing down as database size increases (newb)

2008-10-29 Thread Neville Franks
The most common reason which comes up here time and again is that the inserts are wrapped in a transaction. See BEGIN, END statements in the Docs. You haven't mentioned whether you are using a transaction, so I may be misguided in my reply. But the sample code doesn't! Wednesday, October 29,

[sqlite] insert speeds slowing down as database size increases (newb)

2008-10-29 Thread Julian Bui
Hi everyone, First off, I'm a database and sqlite newbie. I'm inserting many many records and indexing over one of the double attributes. I am seeing my insert times slowly degrade as the database grows in size until it's unacceptable - less than 1 write per millisecond (other databases have