You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/* Maximal size of buffer for compressing (size) bytes where (size) is equal to PostgreSQL page size.
18
+
* Some compression algorithms requires to provide buffer large enough for worst case and immediately returns error is buffer is not enough.
19
+
* Accurate calculation of required buffer size is not needed here and doubling buffer size works for all used compression algorithms. */
18
20
#defineCFS_MAX_COMPRESSED_SIZE(size) ((size)*2)
21
+
22
+
/* Minimal compression ratio when compression is expected to be reasonable.
23
+
* Right now it is hardcoded and equal to 2/3 of original size. If compressed image is larger than 2/3 of original image,
24
+
* then uncompressed version of the page is stored.
25
+
*/
19
26
#defineCFS_MIN_COMPRESSED_SIZE(size) ((size)*2/3)
20
27
21
28
/* Possible options for compression algorithm choice */
@@ -40,7 +47,8 @@
40
47
#defineCFS_RC4_DROP_N 3072
41
48
#defineCFS_CIPHER_KEY_SIZE 256
42
49
43
-
/* TODO Add comment */
50
+
/* Inode type is 64 bit word storing offset and compressed size of the page. Size of Postgres segment is 1Gb, so using 32 bit offset is enough even through
51
+
* with compression size of compressed file can become larger than 1Gb if GC id disabled for long time */
0 commit comments