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

Commit 71b964f

Browse files
author
Nikita Glukhov
committed
Fix XXX comment about multipass value collection
1 parent f2b4c12 commit 71b964f

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

src/backend/utils/adt/jsonb_typanalyze.c

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1228,18 +1228,14 @@ compute_json_stats(VacAttrStats *stats, AnalyzeAttrFetchFunc fetchfunc,
12281228

12291229
oldcxt = MemoryContextSwitchTo(tmpcxt);
12301230

1231-
/*
1232-
* XXX If I understand correctly, we simply collect all paths first,
1233-
* without accumulating any Values. And then in the next step we
1234-
* process each path independently, probably to save memory (we
1235-
* don't want to accumulate all values for all paths, with a lot
1236-
* of duplicities).
1237-
*/
1238-
1239-
/* Collect all paths first and sort them */
1231+
/* Collect all paths first without accumulating any Values, sort them */
12401232
jsonAnalyzePass(&ctx, jsonAnalyzeCollectPaths, (void *)(intptr_t) false);
12411233
jsonAnalyzeSortPaths(&ctx);
12421234

1235+
/*
1236+
* Next, process each path independently to save memory (we don't want
1237+
* to accumulate all values for all paths, with a lot of duplicities).
1238+
*/
12431239
MemoryContextReset(tmpcxt);
12441240

12451241
for (i = 0; i < ctx.npaths; i++)

0 commit comments

Comments
 (0)