Adrien Nayrat

Reading time: 8 minutes

Tags:   postgresql (141)   france (17)   dba (7)   consulting (4)   opensource (16)   freelance (1)  
Category:   Interviews   
Interview conducted by: Andreas Scherbaum

PostgreSQL is the World’s most advanced Open Source Relational Database. The interview series “PostgreSQL Person of the Week” presents the people who make the project what it is today. Read all interviews here.

Please tell us about yourself, and where you are from.

I live in Valence (in France not Spain), I am 36.
I work as PostgreSQL DBA since 2015, and I have been a freelance consultant since 2021.
I moved to several places in France (Brest, Rennes) and landed in Valence. I was looking for a small city, near the mountains.

Adrien Nayrat

Adrien Nayrat

How do you spend your free time? What are your hobbies?

When I am not landed, I am on a cliff. I practice climbing and it is my main hobby. It is good to spend time in the nature, with friends, sometimes scary!
When I am not on a cliff, I read stuff on Postgres and socialize sometimes ^^

Any Social Media channels of yours we should be aware of?

Last book you read? Or a book you want to recommend to readers?

It is “Le livre de maître Mô” (The book of Mr Mô) by Jean-Yves Moyart.
He was a lawyer and his book was like an outlet of several cases.
His death really moved me because he was full of humanity, He was really known before social media when first blogs appeared. He was also famous on Twitter and many people honored him. So much that someone said “maintenant on connait le bruit que fait un réseau social qui pleure “ (now, we know the noise of a crying social network).

Any favorite movie, or show?

I really enjoyed Whiplash by Damien Chazelle. It is about the story between a drummer and a tyrannical teacher. I loved the music and the actors’ performances.

What does your ideal weekend look like?

Move with friends to a cliff, climb during the day, camping near the cliff.

What’s still on your bucket list?

Answer to this question ^^

What is the best advice you ever got?

A math teacher said something like “you have to go slow to go fast”.
The idea behind is to take the time to think, in order to start on good foundations and build something strong.
Exactly how Postgres is developed from my point of view.

When did you start using PostgreSQL, and why?

When I moved to Valence in 2013, I worked more like a jack of all trades in system, linux, network and database.
At that time, Postgres was a black box in our infrastructure, and we had performance issues.
I followed a PostgreSQL course and really enjoyed it. I keep learning it in my free time, and started to write articles on my blog. That’s how my Postgres history started :)

Do you remember which version of PostgreSQL you started with?

I think it was a 9.2, but I worked on older versions since I am a consultant.

I studied network and telecommunications with computer science too.
Computer science was useful, I completely forgot my database course, I just remember a lesson on recursive CTE which impressed me.

What other databases are you using? Which one is your favorite?

I only use Postgres.

I recently took a look at Netdata. A developer is moving the Postgres plugin from Python to Go.
I try to review the changes and give a few ideas.

How do you contribute to PostgreSQL?

I reported bugs in the past. I think my first contribution was on Postgres documentation.
Later, I reviewed patches and also wrote patches.
I hope to spend more time on this. It is an excellent exercise to dig into Postgres internals.

Any contributions to PostgreSQL which do not involve writing code?

I wrote technical articles on my blog. I gave conferences at the pgday.
I try to participate in the Postgres ecosystem for example Powa, netdata, check_pgactivity, pgbadger… Unfortunately, I am not very consistent.

What is your favorite PostgreSQL extension?

I would rather speak about what I call “Powa stack”:

  • pg_stat_statements
  • pg_stat_kcache
  • pg_qual_stats
  • pg_wait_sampling
  • pg_track_settings
  • hypopg

For me, it is the dream stack for a DBA. pg_stat_kcache gathers statistics down to the system level (IO from disk, CPU, memory). pg_qual_stats collects predicate statistics. pg_wait_sampling collects metrics about wait_event for each query. All these extensions are aggregated by powa. Thus, you will have many statistics about your workload. This helps the DBA to find expensive queries and fix them. Powa is even able to suggest an index. Thanks to hypopg, it can estimate the gain if you add such an index. Powa was able to suggest index for itself.

What is the most annoying PostgreSQL thing you can think of? And any chance to fix it?

Nothing really annoys me with Postgres. Maybe the lack of possibility to give more information to the optimizer. I share most of the concerns about why there are no hints in Postgres. But sometimes, in case of misestimation (correlated data across joins for example). It could be useful to give information to the optimizer in order for it to make a better decision. I completely share the idea that we shouldn’t tell the optimizer what to do. But giving information in order to help it seems useful.

I hope there will be more features around this in the future (this thread, for example).

I also think we should have the possibility to ask the optimizer to spend more time on planning queries.

In my previous job, colleagues even had to write an extension for this.

Sometimes we may want to spend hundreds of milliseconds or even seconds to plan a long-running query.

Just to be precise, I am not really annoyed by this, it is just a good improvement.

I am much more annoyed by ORM, dates stored as varchar, useless DISTINCT, lack of indexes on FK, join on numeric…

What is the feature you like most in the latest PostgreSQL version?

I can’t choose one feature, I listed 5 from release note:

  • Allow ICU collations to be set as the default for clusters and databases
  • Allow WAL full page writes to use LZ4 and Zstandard compression
  • Add support for LZ4 and Zstandard compression of server-side base backups
  • Allow WAL processing to pre-fetch needed file contents

I just miss zstd for the toast compression 🙁

Adding to that, what feature/mechanism would you like to see in PostgreSQL? And why?

  • Graceful restart for minor updates. It is annoying to see a not updated Postgres instance because the customer did not want a downtime.
  • UDDSketch or tdigest in pg_stat_statements. Thus, we could compute the query execution percentile. Combined with powa, I dream of a possibility to compare CDF over time. It could be useful in Postgres development to compare performance gain or degradation.
  • Logical replication on standby or Failover Slot

Could you describe your PostgreSQL development toolbox?

I mostly use vim, git (and tig), sometimes I use kdevelop as IDE.
Gcc for the compilation and gdb when I need to understand how Postgres works.

Which skills are a must have for a PostgreSQL developer/user?

Willing to learn, finding the information. Most of the time, answers are in the Postgres documentation already.

Do you use any git best practices, which makes working with PostgreSQL easier?

I am not a git guru at all! I mainly use git diff, bisect, blame, worktree…

Which PostgreSQL conferences do you visit? Do you submit talks?

Pgay Paris, Pgday France, pgcon (favorite one) and pgconf europe.
I gave talks in pgday france and smaller events not dedicated to postgres (local meetup etc).

Do you think PostgreSQL has a high entry barrier?

For a Postgres user, not. There are plenty of articles, documentation, books… Postgres is very easy to install and learn.
If you want to hack Postgres, follow the development, yes. However, good code quality, comments and documentation help.

What is your advice for people who want to start PostgreSQL developing - as in, contributing to the project. Where and how should they start?

First, understand Postgres Internal:

Obviously read the doc
Read the code
Then, review patch, participate on mailing lists etc

Do you think PostgreSQL will be here for many years in the future?

Yes, like Linux. Database principles have stayed accurate since the 70’s.
When NoSQL databases appeared, some people claimed it would be the death of RDBMS, it wasn’t true. Users still rely on relational databases and relational models after 50 years.
Now the hype is on blockchain. I will keep my Postgres to store my data ^^

Would you recommend PostgreSQL for business, or for side projects?

Both for sure!

Postgres is reliable and able to handle most of the database workloads.
Furthermore, as it is open source, you can benefit from its extensibility and its ecosystem:

  • Many extensions
  • For side projects, you can write your own
  • Support companies, you are not tight to company which develop the product

Are you reading the -hackers mailinglist? Any other list?

Yes, I try despite the mail traffic. I also read most of the pgdg mailing list.

What other places do you hang out?

I am mostly on mailing lists.

Which other Open Source projects are you involved or interested in?

I keep an eye on Linux progress and io_uring too.

Anything else you like to add?

Do not forget to keep your Postgres up to date!