-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding documentation and cosmetic fixes
- Loading branch information
Showing
13 changed files
with
43 additions
and
40 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
sql/Connections/activity.sql → sql/Activity/most_active_tables.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Get CREATE TABLE query | ||
|
||
This query brings the DDL of the defined table in the filter `c.relname like '<table>'`. Change the filter with the table that you want to inspect. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 17 additions & 17 deletions
34
sql/Replication/Streaming/leader_replication_status_v10+.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,19 @@ | ||
-- Only for getting the status of those pids for streaming replication. | ||
-- | ||
SELECT client_addr, | ||
client_hostname, | ||
client_port, | ||
rs.slot_name, | ||
rs.slot_type, | ||
state, | ||
pg_wal_lsn_diff(pg_current_wal_flush_lsn(), flush_lsn), --in bytes | ||
pg_size_pretty(pg_wal_lsn_diff(pg_current_wal_flush_lsn(), flush_lsn)), | ||
pg_wal_lsn_diff(pg_current_wal_lsn(), write_lsn) as fromCurrentToWriteLSN, --in bytes | ||
pg_size_pretty(pg_wal_lsn_diff(pg_current_wal_lsn(), write_lsn)) as fromCurrentToWriteLSN_pretty, | ||
write_lsn, sent_lsn, flush_lsn, replay_lsn, | ||
write_lag, flush_lag, replay_lag, | ||
rs.restart_lsn, rs.confirmed_flush_lsn, | ||
sync_state, sync_priority | ||
FROM pg_stat_replication sr JOIN pg_replication_slots rs | ||
ON (sr.pid = rs.active_pid) | ||
WHERE rs.slot_type = 'physical'; | ||
SELECT client_addr, | ||
client_hostname, | ||
client_port, | ||
rs.slot_name, | ||
rs.slot_type, | ||
state, | ||
pg_wal_lsn_diff(pg_current_wal_flush_lsn(), flush_lsn), --in bytes | ||
pg_size_pretty(pg_wal_lsn_diff(pg_current_wal_flush_lsn(), flush_lsn)), | ||
pg_wal_lsn_diff(pg_current_wal_lsn(), write_lsn) as fromCurrentToWriteLSN, --in bytes | ||
pg_size_pretty(pg_wal_lsn_diff(pg_current_wal_lsn(), write_lsn)) as fromCurrentToWriteLSN_pretty, | ||
write_lsn, sent_lsn, flush_lsn, replay_lsn, | ||
write_lag, flush_lag, replay_lag, | ||
rs.restart_lsn, rs.confirmed_flush_lsn, | ||
sync_state, sync_priority | ||
FROM pg_stat_replication sr JOIN pg_replication_slots rs | ||
ON (sr.pid = rs.active_pid) | ||
WHERE rs.slot_type = 'physical'; |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
-- Get settings ordered by context | ||
SELECT name, setting, | ||
short_desc::text , extra_desc::text, | ||
context | ||
FROM pg_settings | ||
ORDER BY context; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Shared Buffers Aggregation | ||
|
||
This query requires the `pg_buffercache` extension installed in the database. | ||
|
||
> NOTE: beware that this extension needs locks for reading blocks in the shared buffers. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Shared Buffers Inspection | ||
|
||
It is recommended to LIMIT the bufs table expression in production environments. | ||
|
||
> NOTE: beware that this extension needs locks over shared buffers, use carefully in production environments. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
-- Execute this on replica to know which is the | ||
-- files need to be copied | ||
-- files need to be copied. This returns the current WAL LSN in the replica, | ||
-- you should copy all the WAL files newer than this point. | ||
select pg_walfile_name(pg_current_wal_lsn()); |