#type
create type dimensions as (
width integer,
height integer,
depth integer
);
create table moving_boxes (
id serial primary key,
dims dimensions not null
);
insert into moving_boxes (dims) values (row(3,4,5)::dimensions);
#perf https://www.percona.com/blog/2020/05/29/removing-postgresql-bottlenecks-caused-by-high-traffic/
Percona Database Performance Blog
Removing PostgreSQL Bottlenecks Caused by High Traffic - Percona Database Performance Blog
Percona's Robert Bernier writes about removing PostgreSQL bottlenecks caused by high traffic.
#index https://info.crunchydata.com/blog/postgresql-brin-indexes-big-data-performance-with-minimal-storage
Crunchydata
PostgreSQL BRIN Indexes: Big Data Performance With Minimal Storage
A PostgreSQL block range index, or BRIN, can help you to significantly reduce the amount of disk space required for high performance queries on big data.
Forwarded from Sysadmin Tools 🇺🇦
Прислали в лс ништяков для postgresql
1) http://pgconfigurator.cybertec.at/
2) https://pgtune.leopard.in.ua/#/
3) https://github.com/jfcoz/postgresqltuner
1) http://pgconfigurator.cybertec.at/
2) https://pgtune.leopard.in.ua/#/
3) https://github.com/jfcoz/postgresqltuner
pgtune.leopard.in.ua
PGTune - calculate configuration for PostgreSQL based on the maximum performance for a given hardware configuration
PgTune - Tuning PostgreSQL config by your hardware
#table fragmentation (#monitoring)
SELECT schemaname,
tablename,
dead_tuple_count(stats) AS dead_tuples,
pg_size_pretty(dead_tuple_len(stats)) AS dead_space,
pg_size_pretty(free_space(stats)) AS free_space,
last_autovacuum,
last_autoanalyze
FROM
(SELECT pgt.schemaname AS schemaname,
pgt.tablename AS tablename,
pgstattuple(pgt.schemaname || '.' || pgt.tablename)
AS stats,
uts.last_autovacuum AS last_autovacuum,
uts.last_autoanalyze AS last_autoanalyze
FROM pg_tables AS pgt
LEFT JOIN pg_stat_user_tables
AS uts
ON pgt.schemaname = uts.schemaname
AND pgt.tablename = uts.relname
WHERE pgt.schemaname NOT IN ('repack','pg_catalog')) AS r
ORDER BY dead_tuples DESC;
#index fragmentation (#monitoring)
SELECT schemaname,
indexname,
tablename,
dead_tuple_count(stats) AS dead_tuples,
pg_size_pretty(dead_tuple_len(stats)) AS dead_space,
pg_size_pretty(free_space(stats)) AS free_space
FROM
(SELECT pgt.schemaname AS schemaname,
pgt.indexname AS indexname,
pgt.tablename AS tablename,
pgstattuple(pgt.schemaname || '.' || pgt.indexname) AS stats
FROM pg_indexes AS pgt
WHERE pgt.schemaname NOT IN ('repack',
'pg_catalog')
AND pgt.indexname NOT IN ('some',
'important',
'triggers')) AS r
ORDER BY dead_tuples DESC;