Database size

Login to reply to this topic.
Tue, 2004-01-27 17:23
Joined: 2004-01-16
Forum posts: 42
Hello !

I'm currently starting with symbian databases. I'm not familiar with indexed databases, and don't understand very well all the concepts.

I have some problems to understand the behavior between index use or not. Let me explain :

I'm creating a table containing two char(128), two uint and a timestamp (I explained the different fields in order to show that one record is not so big Cheezy ). During execution, i need sometimes to add a new record or only update the timestamp of an existing one.

When I create this table with an index, and add 6 records (and update those 6 ones at least one time), the size of the database is 23.5 KB Sad

But, when I create it without index, and launch my app in the same conditions, its size is only 3 KB Smiley

How do I interpret this fact ? Maybe I'm stupid, but I really don't understand.

Another consequence of an index use is that when I tried to open my db, I check if it already exist. If not, I create it. With an Index on it, my app raise a system error if the table doesn't exist. Without index (and the same code Wink ), this error is never raised ....

Thanks to everyone for any help !

Tibo


Wed, 2004-01-28 09:02
Joined: 2003-07-22
Forum posts: 69
Database size
Hi

After the database operations u have to use RDbDatabase::Compact()

Helped u ?

MeenuJ
Wed, 2004-01-28 16:12
Joined: 2003-08-11
Forum posts: 93
Database size
I hope the Compact function helped you i just want to explain to you the concept of indexes so that you are in the picture. THe index is a system designed in the databse to make finding records much more faster than without one. But this as usually comes at and expense which is the size. It also matter on what column you put it on. If you put it on the char(128) it is going to be much greater than if you werer to put it on the TUint columns so you will have to make the Ever lasting question Speed or Size?
Wed, 2004-06-09 07:50
Joined: 2004-06-09
Forum posts: 21
Database size
be aware of one problem with indexes though. if you use transactions when writing to the db and you decide to rollback the transactions, the SDK says the indexes will be in a damaged state and thus unuseable. you will end up with a space overhead that's wasted. you need to repair the db to get it to rebuild the indexes.
  • Login to reply to this topic.