---
title: "How to pre-warm Postgres's I/O caches"
publication: "Postgres Weekly"
issue: 327
published_at: "2019-10-16"
canonical_url: "https://postgresweekly.com/issues/327"
---

The latest Postgres news, articles, tools, and projects.       

#327 — October 16, 2019 

[Read on the Web](https://postgresweekly.com/issues/327)   

Postgres Weekly 

[![\](https://res.cloudinary.com/cpress/image/upload/w_1280,e_sharpen:60/v1571171920/atzjvqowzsi1oceo6pxu.png)](https://postgresql.verite.pro/blog/2019/10/14/nondeterministic-collations.html)  

[Nondeterministic Collations](https://postgresql.verite.pro/blog/2019/10/14/nondeterministic-collations.html) — Postgres 12 supports a new `deterministic` property that can be set to `false` on `CREATE COLLATION` to request that strings be recognized as equal when the underlying locale says they are, even if they are different at the byte level. This opens up a lot of ways to match against text _without_ using explicit functions to do so.. here’s a look at some of them. 

Daniel Verité   

[Prewarming Postgres's I/O Caches](https://www.cybertec-postgresql.com/en/prewarming-postgresql-i-o-caches/) — The more Postgres can cache data in memory and the less it has to hit the disk, the better for performance. But it takes time for the most commonly used parts of a dataset to naturally end up in memory.. so what if you could speed up the process? 

Hans-Jürgen Schönig   [![\](https://copm.s3.amazonaws.com/2db4a8ff.png)](https://pganalyze.com/ebooks/monitoring-postgres-logs?utm_source=PostgresWeeklyPrimary) 

[eBook: The Most Important Events to Monitor in Your Postgres Logs](https://pganalyze.com/ebooks/monitoring-postgres-logs?utm_source=PostgresWeeklyPrimary) — In this pganalyze eBook, we are looking at the Top 6 Postgres log events for monitoring query performance and preventing downtime. 

pganalyze sponsor   

[How to Set Up Streaming Replication in Postgres 12](https://www.percona.com/blog/2019/10/11/how-to-set-up-streaming-replication-in-postgresql-12/) — Percona’s Avinash Vallarapu talks about how to set up streaming replication in Postgres 12, basically a way to keep other servers ‘warm’ with your live data. 

Avinash Vallarapu   

[What Is Autovacuum Doing to My Temporary Tables?](https://www.cybertec-postgresql.com/en/what-is-autovacuum-doing-to-my-temporary-tables/) — Temporary tables are _not_ cleaned up by Postgres’s autovacuum process, you’ve got to do it on your own. Here’s why and how, complete with an example. 

Hans-Jürgen Schönig      supported by [![Digital Ocean\](https://res.cloudinary.com/cpress/image/upload/v1570809425/nlqv0ueejagpj7gkft55.png)](https://try.digitalocean.com/managed-databases-postgresql/?medium=display&utm_source=cooperpress&utm_campaign=MDB_Dev_Signup_Cold_PostgresWeekly10-16-2019)  

💡**Tip of the Week** 

Saving a copy of your `psql` history 

You've been hacking away in `psql` and you've come up with a clever query, want to look back at your work, or otherwise want to show off what you were doing in your session (perhaps to demonstrate to the boss that this database management stuff isn't so easy, after all). You want to see your _history._ 

The easiest way to check your query history is:  

\s   

Easy enough, but did you know that you can also use this to _save_ your history to a file?  

# \s queries.log
 Wrote history to file "queries.log".   

This week’s Tip of the Week is sponsored by [DigitalOcean](https://try.digitalocean.com/managed-databases-postgresql/?medium=display&utm_source=cooperpress&utm_campaign=MDB_Dev_Signup_Cold_PostgresWeekly10-16-2019). Now available: [Worry-free PostgreSQL hosting on DigitalOcean](https://try.digitalocean.com/managed-databases-postgresql/?medium=display&utm_source=cooperpress&utm_campaign=MDB_Dev_Signup_Cold_PostgresWeekly10-16-2019). We’ll handle setting up, backing up, and updating — so you can focus on building great apps.      

📂**Code and Projects**   

[Checking Postgres Object Ownership](http://eulerto.blogspot.com/2019/10/postgres-object-ownership.html) — A rather epic query that can list tables, views, foreign tables and sequences _not_ owned by the `postgres` role. 

Euler Taveira   

[Oracle FDW for Postgres v2.2.0](https://github.com/laurenz/oracle_fdw/releases/tag/ORACLE_FDW_2_2_0) — A foreign data wrapper for easy access to Oracle databases. v2.2.0 adds support for `COPY` for foreign tables and Oracle’s `XMLTYPE`. 

Laurenz Albe   

[Creating a Multi-Layered Secured Postgres Database](https://info.enterprisedb.com/20190821CreatingaMulti-layeredSecuredPostgresDatabase.html?utm_source=Cooperpress&utm_medium=ad) — Learn security best practices for managing your Postgres databases by watching this on-demand webinar. 

EnterpriseDB sponsor   

[asyncpg 0.19.0: A fast Postgres Client Library for Python/asyncio](https://github.com/MagicStack/asyncpg/releases/tag/v0.19.0) — To go with your brand new Python 3.8 (that dropped this week), why not a newly updated high performance client library for `asyncio`. Now supports Postgres 12 and SCRAM-SHA-256 authentication. 

magicstack   

[MobilityDB: A 'Moving Objects' Database (MOD) Built on PostgreSQL and PostGIS](https://github.com/ULB-CoDE-WIT/MobilityDB) — As PostGIS brings geospatial objects to Postgres, MobilityDB aims to go a step further in bringing time into play for representing the _movement_ of items within geographic space. This is very much under development/prototype for now, but may interest some of you. 

ULB-CoDE-WIT   

[A SQL Implementation of An Ancient Handwriting Recognition Algorithm](https://github.com/doersino/handwriting) — Yep, you read that _write_.. ;-) 

Noah Doersing     

🗓**Upcoming Events** 

- [pgDay Santiago](https://www.pgday.cl/2019/) (October 29 in Santiago, Chile) — pgDay Santiago is intended for PostgreSQL users of all levels, with talks for everyone and the chance to meet with your peers.
- [PG Down Under](https://pgdu.org/) (November 15 in Sydney, Australia) — The second outing for this annual, Australian Postgres conference.
- [PgConf.Russia](https://pgconf.ru/2020) (Febuary 3-5, 2020 in Moscow, Russia) — One day of tutorials and two days of talks in three parallel sessions.
- [PGConf India](https://pgconf.in/conferences/pgconfin2020) (Febuary 26-28, 2020 in Bengaluru, Maharashtra, India) — A dedicated training day and a multi-track two-day conference.          

Curated by [Cooperpress](https://cooperpress.com/), [Peter Cooper](https://twitter.com/peterc), and [Craig Kerstiens](https://twitter.com/craigkerstiens). 

[Change your email address](https://postgresweekly.com/edit_subscription/*|UID|*) or[Stop getting this newsletter](https://postgresweekly.com/leave/*|UID|*) 

© Cooper Press Ltd · Fairfield Enterprise Centre, Louth, LN11 0LS, United Kingdom
