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

Commit e767ddc

Browse files
committed
Fix typos and grammar in code comments
Several mistakes have piled in the code comments over the time, including incorrect grammar, function names and simple typos. This commit takes care of a portion of these. No backpatch is done as this is only cosmetic. Author: Justin Pryzby Discussion: https://postgr.es/m/20210924215827.GS831@telsasoft.com
1 parent 895267a commit e767ddc

File tree

8 files changed

+29
-29
lines changed

8 files changed

+29
-29
lines changed

contrib/tablefunc/tablefunc.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1480,7 +1480,7 @@ validateConnectbyTupleDesc(TupleDesc td, bool show_branch, bool show_serial)
14801480
"fifth column must be type %s",
14811481
format_type_be(INT4OID))));
14821482

1483-
/* check that the type of the fifth column is INT4 */
1483+
/* check that the type of the fourth column is INT4 */
14841484
if (!show_branch && show_serial &&
14851485
TupleDescAttr(td, 3)->atttypid != INT4OID)
14861486
ereport(ERROR,

src/backend/commands/statscmds.c

+6-6
Original file line numberDiff line numberDiff line change
@@ -213,14 +213,14 @@ CreateStatistics(CreateStatsStmt *stmt)
213213
* Convert the expression list to a simple array of attnums, but also keep
214214
* a list of more complex expressions. While at it, enforce some
215215
* constraints - we don't allow extended statistics on system attributes,
216-
* and we require the data type to have less-than operator.
216+
* and we require the data type to have a less-than operator.
217217
*
218-
* There are many ways how to "mask" a simple attribute refenrece as an
218+
* There are many ways to "mask" a simple attribute reference as an
219219
* expression, for example "(a+0)" etc. We can't possibly detect all of
220-
* them, but we handle at least the simple case with attribute in parens.
221-
* There'll always be a way around this, if the user is determined (like
222-
* the "(a+0)" example), but this makes it somewhat consistent with how
223-
* indexes treat attributes/expressions.
220+
* them, but we handle at least the simple case with the attribute in
221+
* parens. There'll always be a way around this, if the user is determined
222+
* (like the "(a+0)" example), but this makes it somewhat consistent with
223+
* how indexes treat attributes/expressions.
224224
*/
225225
foreach(cell, stmt->exprs)
226226
{

src/backend/executor/nodeTableFuncscan.c

+9-9
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@
1414
*/
1515
/*
1616
* INTERFACE ROUTINES
17-
* ExecTableFuncscan scans a function.
17+
* ExecTableFuncScan scans a function.
1818
* ExecFunctionNext retrieve next tuple in sequential order.
19-
* ExecInitTableFuncscan creates and initializes a TableFuncscan node.
20-
* ExecEndTableFuncscan releases any storage allocated.
21-
* ExecReScanTableFuncscan rescans the function
19+
* ExecInitTableFuncScan creates and initializes a TableFuncscan node.
20+
* ExecEndTableFuncScan releases any storage allocated.
21+
* ExecReScanTableFuncScan rescans the function
2222
*/
2323
#include "postgres.h"
2424

@@ -46,7 +46,7 @@ static void tfuncLoadRows(TableFuncScanState *tstate, ExprContext *econtext);
4646
/* ----------------------------------------------------------------
4747
* TableFuncNext
4848
*
49-
* This is a workhorse for ExecTableFuncscan
49+
* This is a workhorse for ExecTableFuncScan
5050
* ----------------------------------------------------------------
5151
*/
5252
static TupleTableSlot *
@@ -84,7 +84,7 @@ TableFuncRecheck(TableFuncScanState *node, TupleTableSlot *slot)
8484
}
8585

8686
/* ----------------------------------------------------------------
87-
* ExecTableFuncscan(node)
87+
* ExecTableFuncScan(node)
8888
*
8989
* Scans the function sequentially and returns the next qualifying
9090
* tuple.
@@ -103,7 +103,7 @@ ExecTableFuncScan(PlanState *pstate)
103103
}
104104

105105
/* ----------------------------------------------------------------
106-
* ExecInitTableFuncscan
106+
* ExecInitTableFuncScan
107107
* ----------------------------------------------------------------
108108
*/
109109
TableFuncScanState *
@@ -205,7 +205,7 @@ ExecInitTableFuncScan(TableFuncScan *node, EState *estate, int eflags)
205205
}
206206

207207
/* ----------------------------------------------------------------
208-
* ExecEndTableFuncscan
208+
* ExecEndTableFuncScan
209209
*
210210
* frees any storage allocated through C routines.
211211
* ----------------------------------------------------------------
@@ -234,7 +234,7 @@ ExecEndTableFuncScan(TableFuncScanState *node)
234234
}
235235

236236
/* ----------------------------------------------------------------
237-
* ExecReScanTableFuncscan
237+
* ExecReScanTableFuncScan
238238
*
239239
* Rescans the relation.
240240
* ----------------------------------------------------------------

src/backend/optimizer/util/pathnode.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ compare_path_costs(Path *path1, Path *path2, CostSelector criterion)
105105
}
106106

107107
/*
108-
* compare_path_fractional_costs
108+
* compare_fractional_path_costs
109109
* Return -1, 0, or +1 according as path1 is cheaper, the same cost,
110110
* or more expensive than path2 for fetching the specified fraction
111111
* of the total tuples.

src/backend/statistics/README

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ hopefully improving the estimates and producing better plans.
1212
Types of statistics
1313
-------------------
1414

15-
There are currently two kinds of extended statistics:
15+
There are currently several kinds of extended statistics:
1616

1717
(a) ndistinct coefficients
1818

@@ -73,8 +73,8 @@ it will do if:
7373

7474
When the above conditions are met, clauselist_selectivity() first attempts to
7575
pass the clause list off to the extended statistics selectivity estimation
76-
function. This functions may not find any clauses which is can perform any
77-
estimations on. In such cases these clauses are simply ignored. When actual
76+
function. This function may not find any clauses which it can perform any
77+
estimations on. In such cases, these clauses are simply ignored. When actual
7878
estimation work is performed in these functions they're expected to mark which
7979
clauses they've performed estimations for so that any other function
8080
performing estimations knows which clauses are to be skipped.

src/backend/statistics/README.mcv

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ MCV lists
22
=========
33

44
Multivariate MCV (most-common values) lists are a straightforward extension of
5-
regular MCV list, tracking most frequent combinations of values for a group of
5+
regular MCV lists, tracking most frequent combinations of values for a group of
66
attributes.
77

88
This works particularly well for columns with a small number of distinct values,
@@ -18,7 +18,7 @@ Estimates of some clauses (e.g. equality) based on MCV lists are more accurate
1818
than when using histograms.
1919

2020
Also, MCV lists don't necessarily require sorting of the values (the fact that
21-
we use sorting when building them is implementation detail), but even more
21+
we use sorting when building them is an implementation detail), but even more
2222
importantly the ordering is not built into the approximation (while histograms
2323
are built on ordering). So MCV lists work well even for attributes where the
2424
ordering of the data type is disconnected from the meaning of the data. For
@@ -53,7 +53,7 @@ Hashed MCV (not yet implemented)
5353
Regular MCV lists have to include actual values for each item, so if those items
5454
are large the list may be quite large. This is especially true for multivariate
5555
MCV lists, although the current implementation partially mitigates this by
56-
performing de-duplicating the values before storing them on disk.
56+
de-duplicating the values before storing them on disk.
5757

5858
It's possible to only store hashes (32-bit values) instead of the actual values,
5959
significantly reducing the space requirements. Obviously, this would only make
@@ -77,7 +77,7 @@ to select the columns from pg_stats. The data is encoded as anyarrays, and
7777
all the items have the same data type, so anyarray provides a simple way to
7878
get a text representation.
7979

80-
With multivariate MCV lists the columns may use different data types, making
80+
With multivariate MCV lists, the columns may use different data types, making
8181
it impossible to use anyarrays. It might be possible to produce a similar
8282
array-like representation, but that would complicate further processing and
8383
analysis of the MCV list.

src/backend/statistics/extended_stats.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -699,11 +699,11 @@ examine_expression(Node *expr, int stattarget)
699699
}
700700

701701
/*
702-
* Using 'vacatts' of size 'nvacatts' as input data, return a newly built
702+
* Using 'vacatts' of size 'nvacatts' as input data, return a newly-built
703703
* VacAttrStats array which includes only the items corresponding to
704-
* attributes indicated by 'stxkeys'. If we don't have all of the per column
705-
* stats available to compute the extended stats, then we return NULL to indicate
706-
* to the caller that the stats should not be built.
704+
* attributes indicated by 'attrs'. If we don't have all of the per-column
705+
* stats available to compute the extended stats, then we return NULL to
706+
* indicate to the caller that the stats should not be built.
707707
*/
708708
static VacAttrStats **
709709
lookup_var_attr_stats(Relation rel, Bitmapset *attrs, List *exprs,

src/common/pg_lzcompress.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -825,7 +825,7 @@ pglz_decompress(const char *source, int32 slen, char *dest,
825825

826826

827827
/* ----------
828-
* pglz_max_compressed_size -
828+
* pglz_maximum_compressed_size -
829829
*
830830
* Calculate the maximum compressed size for a given amount of raw data.
831831
* Return the maximum size, or total compressed size if maximum size is

0 commit comments

Comments
 (0)