If you look at <u>[the code where the compress/leave-as-is decision is made](https://sqlite.org/sqlar/file?name=sqlar.c&ci=tip&ln=326-369)</u>, you will see that the phenomenon over which you worry is already taken into account. Look at line 359 in particular, where the "compressed" size used to decide whether to use compression already has the overhead header/trailer info incorporated.