is there a limit to the size of a SQLite database?

后端 未结 4 952
时光取名叫无心
时光取名叫无心 2020-11-30 08:38

I have read their limits FAQ, they talk about many limits except limit of the whole database.

4条回答
  •  清歌不尽
    2020-11-30 08:56

    It has new limits, now the database size limit is 128TB:

    Every database consists of one or more "pages". Within a single database, every page is the same size, but different database can have page sizes that are powers of two between 512 and 65536, inclusive. The maximum size of a database file is 2147483646 pages. At the maximum page size of 65536 bytes, this translates into a maximum database size of approximately 1.4e+14 bytes (140 terabytes, or 128 tebibytes, or 140,000 gigabytes or 128,000 gibibytes).

    This particular upper bound is untested since the developers do not have access to hardware capable of reaching this limit. However, tests do verify that SQLite behaves correctly and sanely when a database reaches the maximum file size of the underlying filesystem (which is usually much less than the maximum theoretical database size) and when a database is unable to grow due to disk space exhaustion.

提交回复
热议问题