Reputation: 11
I have a hypothetical database of values, with each value being 4 bytes size (i.e. 4,000,000,000). All the values are present in the database, so it begins with 0 and ends with the largest 4-byte number.
For only one time, I want to mark some of these values in the database by adding a number between 1 to 10000 to the column (or space) in front of them.
For example, my database is:
0 1 2 3 4 5 . . . . 10000
And for only one time, I want to mark some of these numbers and add a number in front of them:
0 90 1 2 3 10 4 55 5 6 7 8 9 . . . . 10000
As you can see, I added some numbers in front of only 3 values (0, 3, 4).
My problem is that I have tried many sorts of databases, such as SQL, NoSQL, JSON, etc. But every time I add these numbers to these 3 values, megabytes of data is added to the database size against my expectations.
In other words, I want to be able to add n MB of information to the database, and leave most of the database values untouched, and I expect only n MB of size increase in the database, not more. Can you please help me with it?
Upvotes: 1
Views: 35
Reputation: 1269883
The real question is: Why do you care about "megabytes" of data? Unless you are running this on a mobile device, that is not likely to be a real-world consideration.
Databases incur lots of overhead -- they have indexes, partially filled pages, log files, and so on. They support multiple processors, distributed memory, and multiple disks. They are designed to implement ACID properties and for data retrieval operations. They are not designed to minimize space.
If space is such a concern, you should probably be storing your data in a compressed, flat file format and forego the other capabilities that databases offer.
Upvotes: 1