Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit ea168f2

Browse files
committed
Add GUC variable cfs_compress_temp_relations
1 parent c6c1b19 commit ea168f2

File tree

4 files changed

+18
-1
lines changed

4 files changed

+18
-1
lines changed

src/backend/storage/file/cfs.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,12 @@ bool cfs_encryption;
7979
*/
8080
bool cfs_gc_verify_file;
8181

82+
/*
83+
* GUC variable - whther temporary relations should be compressed
84+
*/
85+
bool cfs_compress_temp_rels;
86+
87+
8288
/* GUC variable - Number of garbage collection background workers. Default = 1 */
8389
int cfs_gc_workers;
8490
/*

src/backend/storage/smgr/md.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ static bool md_use_compression(RelFileNodeBackend rnode, ForkNumber forknum)
221221
if (forknum != MAIN_FORKNUM
222222
|| rnode.node.spcNode == DEFAULTTABLESPACE_OID
223223
|| rnode.node.spcNode == GLOBALTABLESPACE_OID
224-
|| rnode.backend != InvalidBackendId
224+
|| (rnode.backend != InvalidBackendId || cfs_compress_temp_rels)
225225
|| rnode.node.relNode < FirstNormalObjectId)
226226
{
227227
return false;

src/backend/utils/misc/guc.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1749,6 +1749,16 @@ static struct config_bool ConfigureNamesBool[] =
17491749
NULL, NULL, NULL
17501750
},
17511751

1752+
{
1753+
{"cfs_compress_temp_relations", PGC_SIGHUP, UNGROUPED,
1754+
gettext_noop("Compress temporary relations"),
1755+
NULL,
1756+
},
1757+
&cfs_compress_temp_rels,
1758+
false,
1759+
NULL, NULL, NULL
1760+
},
1761+
17521762
/* End-of-list marker */
17531763
{
17541764
{NULL, 0, 0, NULL, NULL}, NULL, false, NULL, NULL, NULL

src/include/storage/cfs.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ extern CfsState* cfs_state;
150150
extern int cfs_level;
151151
extern bool cfs_encryption;
152152
extern bool cfs_gc_verify_file;
153+
extern bool cfs_compress_temp_rels;
153154

154155
extern int cfs_gc_delay;
155156
extern int cfs_gc_period;

0 commit comments

Comments
 (0)