@@ -159,7 +159,8 @@ static JsonbValue *fillCompressedJsonbValue(CompressedJsonb *cjb,
159
159
uint32 offset , JsonValue * result );
160
160
static JsonbContainer * jsonbzDecompress (JsonContainer * jc );
161
161
162
- bool jsonb_sort_field_values = true; /* GUC */
162
+ bool jsonb_sort_field_values = true; /* GUC */
163
+ bool jsonb_partial_decompression = true; /*GUC */
163
164
164
165
JsonValue *
165
166
JsonValueUnpackBinary (const JsonValue * jbv )
@@ -2573,7 +2574,6 @@ CompressedDatumDecompress(CompressedDatum *cd, Size offset)
2573
2574
cd -> decompressed_len = offset ;
2574
2575
}
2575
2576
2576
- #if 0 /* unused */
2577
2577
static void
2578
2578
CompressedDatumDecompressAll (CompressedDatum * cd )
2579
2579
{
@@ -2588,7 +2588,6 @@ CompressedDatumDecompressAll(CompressedDatum *cd)
2588
2588
cd -> decompressed_len = cd -> total_len ;
2589
2589
}
2590
2590
}
2591
- #endif
2592
2591
2593
2592
static void
2594
2593
jsonbzInitContainer (JsonContainerData * jc , CompressedJsonb * cjb , int len )
@@ -2844,7 +2843,8 @@ jsonbzIteratorInit(JsonContainer *jc)
2844
2843
Jsonb * jb = (Jsonb * ) cjb -> datum -> data ;
2845
2844
JsonbContainer * jbc = (JsonbContainer * )((char * ) jb + cjb -> offset );
2846
2845
2847
- //CompressedDatumDecompressAll(cjb->datum);
2846
+ if (!jsonb_partial_decompression )
2847
+ CompressedDatumDecompressAll (cjb -> datum );
2848
2848
2849
2849
return jsonbIteratorInit (jc , jbc , cjb );
2850
2850
}
@@ -2859,7 +2859,10 @@ jsonbzInit(JsonContainerData *jc, Datum value)
2859
2859
cjb -> offset = offsetof(Jsonb , root );
2860
2860
2861
2861
CompressedDatumInit (cd , value );
2862
- CompressedDatumDecompress (cd , 256 );
2862
+ if (!jsonb_partial_decompression )
2863
+ CompressedDatumDecompressAll (cd );
2864
+ else
2865
+ CompressedDatumDecompress (cd , 256 );
2863
2866
2864
2867
jsonbzInitContainer (jc , cjb , VARSIZE_ANY_EXHDR (cd -> data )); // cd->total_len - VARHDRSZ
2865
2868
}
0 commit comments