Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit8c8ced1

Browse files
author
Nikita Glukhov
committed
Optimize jsonb returning, Json allocation
1 parent0932658 commit8c8ced1

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

‎src/backend/utils/adt/jsonb_util.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2715,6 +2715,9 @@ DatumGetJsonbPC(Datum datum, Json *tmp, bool copy)
27152715
datum=PointerGetDatum(pg_detoast_datum_copy(src));
27162716
}
27172717

2718+
if (!jsonb_partial_decompression)
2719+
returnDatumGetJson(datum,&jsonbContainerOps,tmp);
2720+
27182721
CompressedDatumInit(&cd,datum);
27192722

27202723
if (!cd.compressed)

‎src/include/utils/json_generic.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ typedef JsonContainer JsonbContainer;
110110
#else
111111
#definePG_GETARG_JSONB_P(n)DatumGetJsonbP(PG_GETARG_DATUM(n), alloca(sizeof(Json)), false)/* FIXME conditional alloca() */
112112
#endif
113-
#definePG_GETARG_JSONB_PC(n)DatumGetJsonbPC(PG_GETARG_DATUM(n), alloca(sizeof(Json)), false)/* FIXMEconditional alloca() */
113+
#definePG_GETARG_JSONB_PC(n)DatumGetJsonbPC(PG_GETARG_DATUM(n), alloca(JsonAllocSize(16))/* FIXMEsizeof CompressedJsonb */, false)
114114
#definePG_GETARG_JSONB_P_COPY(x)DatumGetJsonbPCopy(PG_GETARG_DATUM(x))
115115

116116
#definePG_FREE_IF_COPY_JSONB(json,n) JsonFree(json)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp