Index Recommendations in PostgreSQL and CockroachDB

Read more →

PostgreSQL, where is my analyze_new_cluster script?

Usually, once you upgraded Postgres clusters, you would need to run ANALYZE on the whole cluster to make sure that the database statistics are up to date. Because you know that not doing it will make your database performance go VERY bad. And if you use pg_upgrade to perform the upgrade, there is a tiny little script you can call to do this analyze process, named analyze_new_cluster.sh in Linux and Unix environment and analyze_new_cluster.
Read more →

[PostgreSQL] B-Tree Deduplication With A Catch

By now everyone would know that PostgreSQL 13 is the best version available for anyone. One of the new features that worth mentioning is the way b-tree index is stored for duplicate values. If you have columns with low-cardinality and have duplicate values in them, Postgres will now store them only once. This means saving space and easier on the I/O for searching the values. Because the performance gain during read is very real and so b-tree deduplication is very recommended.
Read more →

[PostgreSQL] Partitioning Limitations in PostgreSQL 12

Partitioning has been introduced in Postgres 10. But, it wasn’t really working simply because the feature is there for some kind of introductions. The community has been working on it and improved a lot when it was released last year on Postgres version 11, but not until Postgres 12, will be released between late September or early October, that everything is ready for production use where mostly used for OLTP.
Read more →

Kenapa Turis Suka ke Bali?

Seperti yang kita tahu, turis itu suka ke Bali. Hal ini juga saya buktikan ketika sudah berkantor di Belanda dan ketemu dengan banyak orang dari berbagai negara. Mereka hampir pasti pernah ke Bali. Tapi sebenarnya, kenapa?
Read more →

[PostgreSQL] OH, NO! Database-nya Corrupt!

Jika ada hal yang paling mengerikan dari manajemen database, maka saya nomer satukan corruption. Kalau saya kehilangan primary server, masih punya standby, atau backup server. Kalau misalnya yang bermasalah adalah hilangnya data, masih ada backup server juga yang bisa diambil. Tapi, tidak dengan corrupt. Tapi, sebenarnya seperti apa sih data corrupt itu? Beberapa hal yang terjadi dan merupakan bentuk dari database corruption dalam Postgres adalah sebagai berikut: file yang tidak bisa dibaca, misalnya error seperti: could not read block N of relation X/Y/Z: read only 0 of 8192 bytes hilangnya attribute, seperti error: catalog is missing N attribute(s) for relid M rusaknya blok dari data semacam ERROR: invalid page in block %u of relation %s data yang ada di tabel, tapi ketika query dengan membaca index tidak kelihatan dll Ketika ini terjadi, yang paling sedikit dampaknya adalah data tidak bisa diakses atau hilang.
Read more →

Tips Ngusilin Rekan Kantor di PostgreSQL Server

Pernah lihat isinya folder PGDATA di server Postgres? Normalnya, akan berisi kurang lebih seperti ini: drwx——. 6 postgres postgres 4096 Jun 21 16:51 base -rw——-. 1 postgres postgres 44 Jul 2 16:09 current_logfiles drwx——. 2 postgres postgres 4096 Jul 2 16:09 global drwx——. 2 postgres postgres 4096 Jul 2 16:09 log drwx——. 2 postgres postgres 4096 Jun 21 16:45 pg_commit_ts drwx——. 2 postgres postgres 4096 Jun 21 16:45 pg_dynshmem -rw——-. 1 postgres postgres 4513 Jun 21 16:45 pg_hba.
Read more →