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

Commit e959727

Browse files
author
Nikita Glukhov
committed
Fix XXX comment about frequences or array/object lengths
1 parent ff92cfa commit e959727

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/backend/utils/adt/jsonb_typanalyze.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -896,9 +896,8 @@ jsonAnalyzePath(JsonAnalyzeContext *ctx, JsonPathAnlStats *pstats)
896896
jsonAnalyzePathValues(ctx, &vstats->jsons, JSONBOID, pstats->freq);
897897

898898
/*
899-
* lengths and array lengths
900-
*
901-
* XXX Not sure why we divide it by the number of json values?
899+
* Lengths and array lengths. We divide counts by the total number of json
900+
* values to compute correct nullfrac (i.e. not all jsons have lengths).
902901
*/
903902
jsonAnalyzePathValues(ctx, &vstats->lens, INT4OID,
904903
pstats->freq * vstats->lens.values.count /

0 commit comments

Comments
 (0)