HI everyone, I have records in my db that consist of smallint, bigint, smallint, double, char(8). By my calculation that comes to 2 + 8 + 2 + 8 + 8 = 28 Bytes per record. I also have an index over the attribute that is a double.
I inserted 100,000 records into a clean database and the database grew to 240.0MB. That comes out to 2519 Bytes per record (240 * 1024 * 1024 / 100,000). How is that possible? The index can't add THAT MUCH extra space. Results were duplicated when I started with a clean database and inserted other # of records. This is very surprising. I must be doing something wrong. I'm attaching some code. Also to note, I'm using the xerial JDBC driver to do this in java. If anyone knows what may be wrong I'd love to hear feedback. Thanks, Julian <code> //ps is a prepared statement ps = conn.prepareStatement("CREATE table IF NOT EXISTS MY_TABLE(aaa SMALLINT NOT NULL, bbb BIGINT NOT NULL, ccc SMALLINT, ddd DOUBLE, eee CHAR(8));"); ps.execute(); .... ps = conn.prepareStatement("CREATE INDEX IF NOT EXISTS IDX_TIME on CAN_MESSAGES (timeStamp)"); ps.execute(); ... dataInsertPs = conn.prepareStatement("INSERT into CAN_MESSAGES(lru, pgn, bus, timeStamp, messageData) VALUES (?, ?, ?, ?, ? //every dataInsertPs gets added to a batch and committed every 1000 records </code> _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users