Skip to content

Instantly share code, notes, and snippets.

@dronezzzko
dronezzzko / PostgreSQL Snippets.md
Created November 1, 2022 10:01
PostgreSQL Snippets

Usefull PostgreSQL Snippets.

Display the size of all tables

SELECT schemaname,
       C.relname AS "relation",
       pg_size_pretty (pg_relation_size(C.oid)) as table,
       pg_size_pretty (pg_total_relation_size (C.oid)-pg_relation_size(C.oid)) as index,
       pg_size_pretty (pg_total_relation_size (C.oid)) as table_index,
@dronezzzko
dronezzzko / mysql-mariadb-tuning-and-optimization-for-best-performance.md
Last active December 21, 2023 13:47
MySQL/MariaDB Tuning And Optimization For Best Performance

MySQL/MariaDB Tuning And Optimization For Best Performance

OS Level Optimization

Swappiness

sysctl -w vm.swappiness=1
echo "vm.swappiness = 1" | sudo tee -a /etc/sysctl.conf

noatime