Search code examples
postgresqlamazon-web-servicesprovisioned-iops

when doing psql copy as select from table to csv file seeing high writeiops


When doing a psql copy to csv by selecting from table . we are seeing high write iops compared to read iops . What causes the high write iops when writing to causes file instead of db?


Solution

  • The most plausible explanation for heavy writes ocurring during seq scans is the hint bits feature.

    From https://wiki.postgresql.org/wiki/Hint_Bits :

    PostgreSQL's MVCC mechanism provides a lot of useful features, but there are some confusing side effects of the implementation. One revolves around hint bit processing, which can result in heavy writes to a database table even though you're just reading from it.