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 | |
relname AS TableName, | |
to_char(seq_scan, '999,999,999,999') AS TotalSeqScan, | |
to_char(idx_scan, '999,999,999,999') AS TotalIndexScan, | |
to_char(n_live_tup, '999,999,999,999') AS TableRows, | |
pg_size_pretty(pg_relation_size(relname :: regclass)) AS TableSize | |
FROM pg_stat_all_tables | |
WHERE schemaname = 'public' | |
AND 50 * seq_scan > idx_scan -- more then 2% | |
AND n_live_tup > 10000 |
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
[global_config] | |
scroll_tabbar = True | |
suppress_multiple_term_dialog = True | |
tab_position = hidden | |
title_font = DejaVu Sans Mono 9 | |
title_receive_bg_color = "#a40000" | |
title_transmit_bg_color = "#555753" | |
title_use_system_font = False | |
window_state = fullscreen | |
[keybindings] |
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
-- Make sure pg_trgm extension is enabled | |
-- To enable pg_trgm | |
-- CREATE EXTENSION pg_trgm; | |
CREATE INDEX CONCURRENTLY | |
first_name_last_name_idx | |
ON | |
customers | |
USING gin ((lower(first_name) || ' ' || lower(last_name)) gin_trgm_ops) |
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
function docker-ip() { | |
docker inspect --format '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' "$@" | |
} |
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
git_branch=$(git branch 2>/dev/null| sed -n '/^\*/s/^\* //p') | |
git checkout master; | |
git fetch; | |
git pull --rebase origin master; | |
git checkout $git_branch; | |
git rebase master; |