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

Commit ec54a08

Browse files
author
Nikita Glukhov
committed
Remove jsonAnalyzePaths()
1 parent 82a2b8a commit ec54a08

File tree

1 file changed

+12
-22
lines changed

1 file changed

+12
-22
lines changed

src/backend/utils/adt/jsonb_typanalyze.c

Lines changed: 12 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -969,27 +969,6 @@ jsonAnalyzeSortPaths(JsonAnalyzeContext *ctx)
969969
JsonPathStatsCompare);
970970
}
971971

972-
/*
973-
* jsonAnalyzePaths
974-
* Sort the paths and calculate statistics for each of them.
975-
*
976-
* Now that we're done with processing the documents, we sort the paths
977-
* we extracted and calculate stats for each of them.
978-
*
979-
* XXX I wonder if we could do this in two phases, to maybe not collect
980-
* (or even accumulate) values for paths that are not interesting.
981-
*/
982-
static void
983-
jsonAnalyzePaths(JsonAnalyzeContext *ctx)
984-
{
985-
int i;
986-
987-
jsonAnalyzeSortPaths(ctx);
988-
989-
for (i = 0; i < ctx->npaths; i++)
990-
jsonAnalyzePath(ctx, ctx->paths[i]);
991-
}
992-
993972
/*
994973
* jsonAnalyzeBuildPathStatsArray
995974
* ???
@@ -1218,7 +1197,18 @@ compute_json_stats(VacAttrStats *stats, AnalyzeAttrFetchFunc fetchfunc,
12181197
{
12191198
/* Collect all values of all paths */
12201199
jsonAnalyzePass(&ctx, jsonAnalyzeCollectPaths, (void *)(intptr_t) true);
1221-
jsonAnalyzePaths(&ctx);
1200+
1201+
/*
1202+
* Now that we're done with processing the documents, we sort the paths
1203+
* we extracted and calculate stats for each of them.
1204+
*
1205+
* XXX I wonder if we could do this in two phases, to maybe not collect
1206+
* (or even accumulate) values for paths that are not interesting.
1207+
*/
1208+
jsonAnalyzeSortPaths(&ctx);
1209+
1210+
for (int i = 0; i < ctx.npaths; i++)
1211+
jsonAnalyzePath(&ctx, ctx.paths[i]);
12221212
}
12231213
else
12241214
{

0 commit comments

Comments
 (0)