Why is SQLite adding unused disk space to “free-list” after deleting a lot of data in a database?

dba.stackexchange https://dba.stackexchange.com/questions/24519

  •  30-10-2019
  •  | 
  •  

문제

The SQLite FAQ states the following:

(12) I deleted a lot of data but the database file did not get any smaller. Is this a bug?

No. When you delete information from an SQLite database, the unused disk space is added to an internal "free-list" and is reused the next time you insert data. The disk space is not lost. But neither is it returned to the operating system.

Can you explain to me the motives behind that decision (as opposite to returning free space to the OS immediately)? What are the pros and cons of such decision (including non-obvious ones)?

올바른 솔루션이 없습니다

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 dba.stackexchange
scroll top