Skip to content

Commit d9389d3

Browse files
committed
Fix typos and improve comment clarity in SQL files
Code quality improvements: - Fix typos in b2_btree_estimation.sql: - "inspect" → "inspects" - "filed" → "fields" - "fractionnal" → "fractional" - "functionnal" → "functional" - Fix typo in p1_alignment_padding.sql: "alt_shits" → "alt_shifts" - Improve comment readability in s2_pg_stat_statements_report.sql: - Add space after "--" for consistency - "format" → "formatting" for grammatical correctness These changes improve code documentation and fix embarrassing typos that could confuse developers reading the codebase.
1 parent f852239 commit d9389d3

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

sql/b2_btree_estimation.sql

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
-- enhanced version of https://github.com/ioguix/pgsql-bloat-estimation/blob/master/btree/btree_bloat.sql
44

5-
-- WARNING: executed with a non-superuser role, the query inspect only index on tables you are granted to read.
5+
-- WARNING: executed with a non-superuser role, the query inspects only indexes on tables you are granted to read.
66
-- WARNING: rows with is_na = 't' are known to have bad statistics ("name" type is not supported).
77
-- This query is compatible with PostgreSQL 8.2+
88

@@ -26,9 +26,9 @@ with step1 as (
2626
/* per tuple header: add IndexAttributeBitMapData if some cols are null-able */
2727
case
2828
when max(coalesce(s.null_frac,0)) = 0 then 2 -- IndexTupleData size
29-
else 2 + (( 32 + 8 - 1 ) / 8) -- IndexTupleData size + IndexAttributeBitMapData size ( max num filed per index + 8 - 1 /8)
29+
else 2 + (( 32 + 8 - 1 ) / 8) -- IndexTupleData size + IndexAttributeBitMapData size ( max num fields per index + 8 - 1 /8)
3030
end as index_tuple_hdr_bm,
31-
/* data len: we remove null values save space using it fractionnal part from stats */
31+
/* data len: we remove null values save space using its fractional part from stats */
3232
sum((1 - coalesce(s.null_frac, 0)) * coalesce(s.avg_width, 1024)) as nulldatawidth,
3333
max(case when a.atttypid = 'pg_catalog.name'::regtype then 1 else 0 end) > 0 as is_na
3434
from pg_attribute as a
@@ -47,7 +47,7 @@ with step1 as (
4747
s.schemaname = i.nspname
4848
and (
4949
(s.tablename = i.tblname and s.attname = pg_catalog.pg_get_indexdef(a.attrelid, a.attnum, true)) -- stats from tbl
50-
OR (s.tablename = i.idxname AND s.attname = a.attname) -- stats from functionnal cols
50+
OR (s.tablename = i.idxname AND s.attname = a.attname) -- stats from functional cols
5151
)
5252
join pg_type as t on a.atttypid = t.oid
5353
where a.attnum > 0

sql/p1_alignment_padding.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ with recursive constants as (
155155
r1.shifts,
156156
r2.cols as alt_cols,
157157
r2.types as alt_types,
158-
r2.shifts as alt_shits,
158+
r2.shifts as alt_shifts,
159159
r1.pads,
160160
r1.curleft,
161161
r2.pads as alt_pads,

sql/s2_pg_stat_statements_report.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ with pg_stat_statements_slice as (
4646
select
4747
(select datname from pg_database where oid = p.dbid) as database,
4848
(select rolname from pg_roles where oid = p.userid) as username,
49-
--select shortest query, replace \n\n-- strings to avoid email clients format text as footer
49+
-- select shortest query, replace \n\n-- strings to avoid email clients formatting text as footer
5050
substring(
5151
translate(
5252
replace(
@@ -205,7 +205,7 @@ with pg_stat_statements_slice as (
205205
select
206206
(select datname from pg_database where oid = p.dbid) as database,
207207
(select rolname from pg_roles where oid = p.userid) as username,
208-
--select shortest query, replace \n\n-- strings to avoid email clients format text as footer
208+
-- select shortest query, replace \n\n-- strings to avoid email clients formatting text as footer
209209
substring(
210210
translate(
211211
replace(

0 commit comments

Comments
 (0)