Skip to content
HomeVideosBooksBlogs
AllTop postsTopics
Podcasts
HistoryListsWatch laterLiked videosFollowing

The videos, books, blogs and podcasts Hacker News keeps recommending, all in one place.

VideosBooksBlogsPodcastsAboutPrivacySettings

Data from Hacker News, HackerTube, HackerBooks, HackerBlogs and Open Library. Credits · Not affiliated with Y Combinator.

HomeVideosBooksBlogsPodcasts
Ctrl K
    T

    Tomas Vondra

    blog.pgaddict.com · Personal blog · on HN since 2014

    Tomas Vondra is a PostgreSQL developer who writes benchmark-based posts on database performance, filesystems, and the query planner.

    Visit blogHN submissions
    DatabasesSystems & Performance
    What HN says

    HN commenters cite it for evidence on filesystem choice for databases, including the post advising against BTRFS for OLTP, and for planner statistics tips.

    Stats for nerds
    22HN people shared it
    11linked in comments
    210story points
    Sep 2018last shared
    2014people per year2018

    Top posts on HN

    1. 1
      Performance since PostgreSQL 7.4 with pgbench
      2 people · 166 points · first shared 2015 · 32 comments on HN
    2. 2
      Don't use BTRFS for OLTP
      6 people · 24 points · first shared 2015 · 13 comments on HN
    3. 3
      Compiler optimizations vs. PostgreSQL
      2 people · 5 points · first shared 2014 · Discussion on HN
    4. 4
      PostgreSQL Allocation Set internals
      1 person · 4 points · first shared 2014 · Discussion on HN
    5. 5
      PostgreSQL on SSD – 4kB or 8kB pages?
      1 person · 3 points · first shared 2015 · Discussion on HN
    6. 6
      Performance since PostgreSQL 7.4 / TPC-DS
      2 people · 2 points · first shared 2015 · Discussion on HN
    7. 7
      PostgreSQL count_distinct improvements
      1 person · 2 points · first shared 2014 · Discussion on HN
    8. 8
      The two kinds of stats in PostgreSQL
      1 person · 2 points · first shared 2014 · Discussion on HN
    9. 9
      Common issues with PostgreSQL planner statistics
      2 people · 1 points · first shared 2017 · Discussion on HN
    10. 10
      Making debugging with GDB a bit easier – PostgreSQL Addict (2015)
      1 person · 1 points · first shared 2016 · Discussion on HN

    What HN people wrote when they linked it

    • krondorMay 2016

      As zanny said, cow presents an issue for transactional workloads (databases, vm images, etc...) as each write fragments the file, by nature of the process of cow.

      btrfs can handle database workloads but you have to disable cow for them (which you can do at the file, directory, or subvolume level in btrfs). You would specify the nodatacow mount option, or chattr +C (file/directory).

      The btrfs autodefrag is still rather new, and needs some work. I expect that could be the long term fix (manual defrag is fine now, but you wouldn't want to call it frequently on a db file), I'm not sure how ZFS handles the fragmentation, but I do know in the past ZFS observed similar issues (seems to have been mostly resolved). I should also point out that disabling cow doesn't really fully disable it, snapshots can still function, etc... however, I'm sure that once you start to use the other cow functions you might observe slipping performance due to fragmentation of these types of files.

      https://blog.pgaddict.com/posts/friends-dont-let-friends-use-btrfs-for-oltp
      https://bartsjerps.wordpress.com/2013/02/26/zfs-ora-database-fragmentation/

    • nisaMar 2016

      There are lot of missing parts. Everything beyond using it for single disks or with RAID1 is still experimental. It's slow for a lot of use cases like VMs or OLTP ( http://blog.pgaddict.com/posts/friends-dont-let-friends-use-btrfs-for-oltp) and using nodatacow does not count!

      RAID1 is implemented to use the oddness of the pid to decide which disk to read from... RAID5/6 have huge performance problems in certain use-cases. Write hole is apparently still a thing.

      Quota seems to be still broken or difficult to handle, the tooling is not exactly nice or intuitive (this may change in the future).

      Hardware failure handling is nonexistent - it can't detect a broken drive.

      Lot's of other gotchas. Just read the mailing list. I've been fighting against btrfs for a while and I'm happy when I'm not having to deal with it. Works probably fine for desktop usage but don't bother stressing it - at the moment it will break horrible.

    • fnord123Dec 2016

      >We aren't sure why, but when we tried to delete a lot of data (~200GB from each machine which each contain several TB of data), our databases become unresponsive for an hour.

      There used to be an issue where users hitting their quota couldn't delete files since for some reason deleting a file meant creating a file somehow. The trick was to find some reasonably large file and `echo 1 > large_file` which truncates the file and frees up enough space that you can begin removing files. Maybe this kind of trick could help you guys.

      That said, it's inadvisable to run a database on a btree file system like ZFS or btrfs if you're keeping an eye on the write performance.
      cf Postgres 9.0 High Performance by Gregory Smith (https://www.amazon.com/PostgreSQL-High-Performance-Gregory-Smith/dp/184951030X)

      and

      https://blog.pgaddict.com/posts/postgresql-performance-on-ext4-and-xfs

    • zzzzzthrowawayFeb 2016

      Probably rhymes with "btrfs balance".

      I'v had the misfortune of using btrfs in production with a few hundred machines on Ubuntu 14.04. It's one of the most finicky filesystems I've ever used. It's probably better in newer kernels, but if you have a lot of churn it requires constant care and feeding and tends to cause kernel softlockups fairly commonly.

      Also this: http://blog.pgaddict.com/posts/friends-dont-let-friends-use-btrfs-for-oltp
      and this: https://www.phoronix.com/scan.php?page=news_item&px=CoreOS-Btrfs-To-EXT4-OverlayFS
      and this (old but a few of the points still apply): http://coldattic.info/shvedsky/pro/blogs/a-foo-walks-into-a-bar/posts/70

      That being said I'm sure there are plenty of use cases for which btrfs in its current capacity is more than sufficient.

    • pgaddictMar 2015

      In my experience the wisdom "GIN is slower to update than GiST" is mostly obsolete nowadays. At least that's what my benchmark results suggest http://blog.pgaddict.com/posts/performance-since-postgresql-7-4-to-9-4-fulltext

      It's also a bit shortsighted to look at the index maintenance in isolation - when your workload is 99% reads, and queries with GIN indexes are way faster, it's probably more efficient to use GIN indexes.

      Moreover, there are often more expensive parts when inserting/updating data (either inside the database, or in the application), so the index maintenance is not really the main problem.

      I'm sure there are workloads where it's still true, though.

    • snakySep 2018

      It depends on transactions obviously (among many other factors). MySQL would handle simple one-insert web-style ones pretty well. At the same time very simple (but slightly more realistic) read-write transactions barely got 2500 tps on PostgreSQL with Xeons and SSDs with as low as 32 clients and almost no contention at all (https://blog.pgaddict.com/posts/performance-since-postgresql-7-4-to-9-4-pgbench). And all transactions were the same, and there were no long-lived ones, no distributed ones, and no rollbacks, and so on.

    Related

    Markus Winanduse-the-index-luke.com171 people

    MongoDB is to NoSQL like MySQL to SQL - in the most harmful way

    Markus Winand
    Personal · last shared 2026
    Percona Blogpercona.com327 people

    UUIDs are popular, but bad for performance (2019)

    Percona Blog
    Company · last shared 2026
    Robert Haasrhaas.blogspot.com96 people

    New Features Coming in PostgreSQL 10

    Robert Haas
    Personal · last shared 2026
    2ndQuadrant Blogblog.2ndquadrant.com99 people

    Data Loss at GitLab

    2ndQuadrant Blog
    Company · last shared 2025
    End Point Blogblog.endpoint.com33 people

    Bucardo 5, async replication for PostgreSQL with true multi-master

    End Point Blog
    Company · last shared 2017
    Domas Mituzasdom.as25 people

    MySQL is bazillion times faster than MemSQL

    Domas Mituzas
    Personal · last shared 2024
    CYBERTEC Blogcybertec-postgresql.com94 people

    Postgres scaling advice

    CYBERTEC Blog
    Company · last shared 2026
    Dimitri Fontainetapoueh.org48 people

    Aggregating NBA data, PostgreSQL vs MongoDB

    Dimitri Fontaine
    Personal · last shared 2026