Skip to content

Commit bb9c89b

Browse files
committed
Polish codebase: fix grammar, typos, and code quality issues
- Fix grammar in README.md: "incomplete list" → "an incomplete list" - Improve README.md formatting for better readability - Fix shell script formatting in generate.sh (add missing space) - Update PostgreSQL terminology: "master" → "primary" in all SQL files - Fix typos in SQL comments: "inspect" → "inspects", "Vaccuum" → "Vacuum" - Remove duplicate random_page_cost entry in t1_tuning.sql - Remove redundant CTE in i2_redundant_indexes.sql - Regenerate start.psql file with updated changes
1 parent 81c8d4d commit bb9c89b

File tree

8 files changed

+11
-20
lines changed

8 files changed

+11
-20
lines changed

README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Questions? Ideas? Contact me: nik@postgres.ai, Nikolay Samokhvalov.
1414

1515
## Credits
1616

17-
**postgres_dba** is based on useful queries created and improved by many developers. Here is incomplete list of them:
17+
**postgres_dba** is based on useful queries created and improved by many developers. Here is an incomplete list of them:
1818
* Jehan-Guillaume (ioguix) de Rorthais https://github.com/ioguix/pgsql-bloat-estimation
1919
* Alexey Lesovsky, Alexey Ermakov, Maxim Boguk, Ilya Kosmodemiansky et al. https://github.com/dataegret/pg-utils
2020
* Josh Berkus, Quinn Weaver et al. from PostgreSQL Experts, Inc. https://github.com/pgexperts/pgx_scripts
@@ -104,9 +104,7 @@ If you are running psql and Postgres server on the same machine, just launch psq
104104
psql -U <username> <dbname>
105105
```
106106

107-
And type `:dba <Enter>` in psql. (Or `\i /path/to/postgres_dba/start.psql` if you haven't added shortcut to your `~/.psqlrc` file).
108-
109-
– it will open interactive menu.
107+
And type `:dba <Enter>` in psql. (Or `\i /path/to/postgres_dba/start.psql` if you haven't added shortcut to your `~/.psqlrc` file). This will open an interactive menu.
110108

111109
### Connect to Remote Postgres Server
112110
What to do if you need to connect to a remote Postgres server? Usually, Postgres is behind a firewall and/or doesn't listen to a public network interface. So you need to be able to connect to the server using SSH. If you can do it, then just create SSH tunnel (assuming that Postgres listens to default port 5432 on that server:

init/generate.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,5 +84,5 @@ echo " \\ir ./$OUT" >> "$OUT"
8484
echo "\\endif" >> "$OUT"
8585

8686
echo "Done."
87-
cd ->/dev/null
87+
cd - >/dev/null
8888
exit 0

sql/0_node.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ select
3030
end)::int)::text || ' second')::interval)::text
3131
|| '; paused: ' || :postgres_dba_is_wal_replay_paused()::text || ')'
3232
else
33-
'Master'
33+
'Primary'
3434
end as value
3535
union all
3636
(

sql/b1_table_estimation.sql

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
--This SQL is derived from https://github.com/ioguix/pgsql-bloat-estimation/blob/master/table/table_bloat.sql
44

55
/*
6-
* WARNING: executed with a non-superuser role, the query inspect only tables you are granted to read.
6+
* WARNING: executed with a non-superuser role, the query inspects only tables you are granted to read.
77
* This query is compatible with PostgreSQL 9.0 and more
88
*/
99

@@ -85,10 +85,10 @@ select
8585
then '~' || pg_size_pretty((real_size - bloat_size)::numeric)
8686
else null
8787
end as "Live",
88-
greatest(last_autovacuum, last_vacuum)::timestamp(0)::text
88+
greatest(last_autovacuum, last_vacuum)::timestamp(0)::text
8989
|| case greatest(last_autovacuum, last_vacuum)
9090
when last_autovacuum then ' (auto)'
91-
else '' end as "Last Vaccuum",
91+
else '' end as "Last Vacuum",
9292
(
9393
select
9494
coalesce(substring(array_to_string(reloptions, ' ') from 'fillfactor=([0-9]+)')::smallint, 100)

sql/i2_redundant_indexes.sql

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
-- -- so feel free to use it in your clouds (Heroku, AWS RDS, etc)
88

99
-- (Keep in mind, that on replicas, the whole picture of index usage
10-
-- is usually very different from master).
10+
-- is usually very different from the primary).
1111

1212
with fk_indexes as (
1313
select
@@ -116,12 +116,6 @@ redundant_indexes_tmp_num as (
116116
*
117117
from redundant_indexes_tmp_cut
118118
order by index_size_bytes desc
119-
), redundant_indexes_grouped as (
120-
select
121-
distinct(num),
122-
*
123-
from redundant_indexes_tmp_cut
124-
order by index_size_bytes desc
125119
)
126120
select
127121
schema_name,

sql/i4_invalid_indexes.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
-- -- so feel free to use it in your clouds (Heroku, AWS RDS, etc)
88

99
-- (Keep in mind, that on replicas, the whole picture of index usage
10-
-- is usually very different from master).
10+
-- is usually very different from the primary).
1111

1212
select
1313
coalesce(nullif(pn.nspname, 'public') || '.', '') || pct.relname as "relation_name",

sql/i5_indexes_migration.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@
2121

2222
-- It also doesn't do anything except reading system catalogs and
2323
-- printing NOTICEs, so you can easily run it on your
24-
-- production *master* database.
24+
-- production *primary* database.
2525
-- (Keep in mind, that on replicas, the whole picture of index usage
26-
-- is usually very different from master).
26+
-- is usually very different from the primary).
2727

2828
-- TODO: take into account type of index and opclass
2929
-- TODO: schemas

sql/t1_tuning.sql

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,6 @@ where
110110
'autovacuum_vacuum_scale_factor',
111111
'autovacuum_work_mem',
112112
'autovacuum_naptime',
113-
'random_page_cost',
114113
'seq_page_cost'
115114
)
116115
order by category, name;

0 commit comments

Comments
 (0)