Does sqlite3 compress data?

后端 未结 3 1879
一生所求
一生所求 2020-12-16 10:32

I\'ve got an 7.4Gb csv file. After converting it to a sqlite database with a python script the output DB is 4.7Gb, around 60% of the original size.

The csv has aroun

3条回答
  •  执念已碎
    2020-12-16 10:47

    SQLite is not running a compression algorithm, but it will store data in a binary file instead of a text file. Which means that the data can be stored more efficiently, for example using a 32-bit (4 byte) number to represent 10,000,000 instead of storing it as 8 bytes of text (or more if the file is unicode).

    Here are more details on the SQL Database File Format if you are interested.

    Does that make sense?

提交回复
热议问题