This file contains hidden or 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
SELECT recordtime, | |
username, | |
dbname, | |
remotehost, | |
remoteport | |
FROM stl_connection_log | |
WHERE event = 'initiating session' | |
AND pid NOT IN (SELECT pid | |
FROM stl_connection_log | |
WHERE event = 'disconnecting session') |
This file contains hidden or 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
SELECT table_id, | |
last_update, | |
lock_owner, | |
lock_owner_pid, | |
lock_status | |
FROM stv_locks; |
This file contains hidden or 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
select pg_terminate_backend('lock_owner_pid'); |
This file contains hidden or 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
cancel 'pid'; |
This file contains hidden or 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
ip link show eth0 |
This file contains hidden or 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
sudo ip link set dev eth0 mtu 1500 |
This file contains hidden or 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
SELECT pid, | |
user_name, | |
starttime, | |
duration, | |
query | |
FROM stv_recents | |
WHERE status = 'Running' | |
ORDER BY user_name DESC; |
This file contains hidden or 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
SELECT TRUNC(starttime) AS day, | |
colname, | |
err_reason, | |
COUNT(*) AS amount | |
FROM stl_load_errors | |
WHERE starttime >sysdate -1 | |
GROUP BY day, | |
colname, | |
err_reason | |
ORDER BY day, |
This file contains hidden or 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
SELECT TRUNC(starttime) AS day, | |
colname, | |
err_reason, | |
filename, | |
line_number | |
FROM stl_load_errors | |
WHERE colname = 'err' | |
GROUP BY day, | |
colname, | |
err_reason, |
This file contains hidden or 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
UNLOAD ('SELECT "ts", "column_a", "column_b" | |
FROM schema.table | |
WHERE ts >= (SELECT DATE_TRUNC(\'day\', (SELECT sysdate - 1))) | |
AND ts < (SELECT DATE_TRUNC(\'day\', (SELECT sysdate)))' | |
) | |
TO 's3://bucket/prefix' | |
GZIP | |
ESCAPE; |
OlderNewer