Re: [sqlite] In-memory database: manually modifying ROWID value increases memory.

2007-10-17 Thread John Stanton
Babu, Lokesh wrote: sorry I forgot to mention the sqlite version that I'm using, its SQLite 3.3.8. Below is the sample code that I tried, static char *database_name = ":memory:"; static sqlite3* db_handle; #define PRINT_TIME \ { \ unsigned long millisec = clock(); \

Re: [sqlite] In-memory database: manually modifying ROWID value increases memory.

2007-10-17 Thread Babu, Lokesh
sorry I forgot to mention the sqlite version that I'm using, its SQLite 3.3.8. Below is the sample code that I tried, static char *database_name = ":memory:"; static sqlite3* db_handle; #define PRINT_TIME \ { \ unsigned long millisec = clock(); \ printf("milliseconds = %ld\n",

Re: [sqlite] In-memory database: manually modifying ROWID value increases memory.

2007-10-17 Thread Vitali Lovich
Well, rough calculations indicate that the situation that sqlite preallocates about an additional 3 rows every time a new ROWID is assigned (on the fairly common use case that ROWID is always monotonically increasing). Assuming that this corner case is not accounted for, it could be that when

Re: [sqlite] In-memory database: manually modifying ROWID value increases memory.

2007-10-17 Thread Scott Hess
Could it be that you're seeing the btree optimization around in-order insertion? From btree.c: #ifndef SQLITE_OMIT_QUICKBALANCE /* ** A special case: If a new entry has just been inserted into a ** table (that is, a btree with integer keys and all data at the leaves) ** and the new entry

Re: [sqlite] In-memory database: manually modifying ROWID value increases memory.

2007-10-17 Thread Babu, Lokesh
Dear all, I'll reframe the question again, If ROWID(hidden column/b-tree key/internal to all table) is changed manually, means I'll insert some unique values in random order / in descending order (say from 1 to 1), the memory occupied increases more. why? I observed entire table is getting

Re: [sqlite] In-memory database: manually modifying ROWID value increases memory.

2007-10-16 Thread Vitali Lovich
My question is how you're measuring the memory useage? Are you accounting for the space overhead of the various bookkeeping sqlite needs (i.e. master table)? The way you're creating you're table implies you're not using autoincrement for the integer field - are you accounting for the extra

Re: [sqlite] In-memory database: manually modifying ROWID value increases memory.

2007-10-15 Thread Joe Wilson
It could be malloc fragmentation. Which sqlite version, operating system, and malloc implementation are you using? --- "Babu, Lokesh" <[EMAIL PROTECTED]> wrote: > Say I have 3 columns in one Table, with one INTEGER, two TEXT columns, If > ROWID is manually inserted and made descending for 1

[sqlite] In-memory database: manually modifying ROWID value increases memory.

2007-10-15 Thread Babu, Lokesh
Dear All, Say I have 3 columns in one Table, with one INTEGER, two TEXT columns, If ROWID is manually inserted and made descending for 1 records from 1 to 1, (or even if random number for ROWID - both these cases), the memory occupied is more. Why is this so? Is that indexing happens, If