Dimitri Fontaine's Blog

December 25, 2019

pgDay Paris 2019 presentation: How to write SQL queries?

The videos from pgDay Paris 2019 are online, and
they look stunning! If you’ve been to the conference, you will be able to
enjoy great memories, and if you’ve not been there, you can now enjoy all
the fine content that was recorded there at the Youtube Channel for
pgDay.Paris
.



This year at pgday Paris I tried something new. My presentation was
interactive, and I’ve been writing queries together with the audience,
making mistakes, loosing keystrokes and having all the fun!



The idea behind looking like a fool writing queries in front of an audience
was to show the process behind those elegant queries that we tend to share
in one piece, on a slide where they shine, beautifully indented. We don’t
get to those queries writing them like we would prose. It takes multiple
iterations to get there. From something quite simple to something more and
more sophisticated, until we have exactly the result set we are interested
in.



 •  0 comments  •  flag
Share on Twitter
Published on December 25, 2019 13:15

November 29, 2019

Black Friday & Cyber Monday

Photo by Alberto Bigoni unsplash-logoAlberto Bigoni Today is Black Friday, then followed by a week end that leads directly to Cyber Monday. This is a period where you can find great deals online, with many discounts. I’ll make it short, because we all are busy, right?
From today to Monday included my book The Art of PostgreSQL is available at a 50% discount with the coupon ���BLACKFRIDAY2019���. Enjoy!
 •  0 comments  •  flag
Share on Twitter
Published on November 29, 2019 07:15

November 6, 2019

PostgreSQL Query Plan Visualizer

Photo by unsplash-logoHanna Morris Postgres Query Planning PostgreSQL provides advanced tooling to understand how it executes SQL queries. The execution of a query follows specific steps:
Parsing Planning Optimization Execution When it comes to the execution step, all Postgres does is follow the selected optimized plan. It is possible to ask Postgres for the query plan and inspect it, in order to better understand the execution of any query and then when necessary find a way to execute the same query faster.
 •  0 comments  •  flag
Share on Twitter
Published on November 06, 2019 11:45

October 13, 2019

Table of Content

Photo by unsplash-logoNicole Honeywill / Sincerely Media Each part of The Art of PostgreSQL can be read on its own, or you can read this book from the first to the last page in the order of the parts and chapters therein. A great deal of thinking have been put in the ordering of the parts, so that reading ���The Art of PostgreSQL��� in a linear fashion should provide the best experience.
 •  0 comments  •  flag
Share on Twitter
Published on October 13, 2019 15:05

Compute database size

Photo by unsplash-logoCharles �������� It is well known that database design should be as simple as possible, and follow the normalization process. Except in some cases, sometimes, for scalability purposes. Partitioning might be used to help deal with large amount of data for instance.
But what is a large amount of data? Do you need to pay attention to those scalability trade-offs now, or can you wait until later?
 •  0 comments  •  flag
Share on Twitter
Published on October 13, 2019 15:05

September 27, 2019

Why Postgres?


Photo by Emily Morter
unsplash-logoEmily Morter




That’s a very popular question to ask these days, it seems. The quick answer
is easy and is the slogan of PostgreSQL, as seen on the community website
for it: ���PostgreSQL: The World’s Most Advanced Open Source Relational
Database���. What does that mean for you, the developer?



In my recent article The Art of PostgreSQL: The Transcript, part I
you will read why I
think it’s interesting to use Postgres in your application’s stack. My
conference talk addresses the main area where I think many people get it
wrong:



Postgres is a RDBMS

RDBMS are not a storage solution

Do not use Postgres to solve a storage problem!

 •  0 comments  •  flag
Share on Twitter
Published on September 27, 2019 06:15

September 25, 2019

The Art of PostgreSQL: The Transcript, part III

This article is a transcript of the conference I gave at Postgres Open 2019,
titled the same as the book: The Art of
PostgreSQL
. It’s availble as a video online
at Youtube if you want to watch the slides and listen to it, and it even has
a subtext!







Some people still prefer to read the text, so here it is. This text is the
third part of the transcript of the video.



The first part is available at The Art of PostgreSQL: The Transcript, part
I
.



The second part is available at The Art of PostgreSQL: The Transcript, part
II
.



 •  0 comments  •  flag
Share on Twitter
Published on September 25, 2019 02:14

September 23, 2019

The Art of PostgreSQL: The Transcript, part II

This article is a transcript of the conference I gave at Postgres Open 2019,
titled the same as the book: The Art of
PostgreSQL
. It’s availble as a video online
at Youtube if you want to watch the slides and listen to it, and it even has
a subtext!







Some people still prefer to read the text, so here it is. This text is the
second part of the transcript of the video. The first part is available at
The Art of PostgreSQL: The Transcript, part I
.

 •  0 comments  •  flag
Share on Twitter
Published on September 23, 2019 03:15

September 20, 2019

The Art of PostgreSQL: The Transcript, part I

This article is a transcript of the conference I gave at Postgres Open 2019,
titled the same as the book: The Art of
PostgreSQL
. It’s availble as a video online
at Youtube if you want to watch the slides and listen to it, and it even has
a subtext!







Some people still prefer to read the text, so here it is.

 •  0 comments  •  flag
Share on Twitter
Published on September 20, 2019 11:15

September 16, 2019

How to Learn SQL?

Here we are, another SQL query to write. You wish you knew how to write that
mechanically, like you would a loop in your favorite programming language.
Or at least have a pretty clear idea of a skeleton to tweak until it gives
the result set you expect. So instead of working on your SQL query, you
google How to write a SQL query? or maybe even How to learn SQL?
Right. I feel you, I’ve been there too, even if quite some time ago���



So here my article where I teach you how to learn SQL.



I want to share with you how I did it, and how I continue to do it. There’s
no magic secret sauce to it though, it’s all basic work. Again, we have to
learn the main concepts and how they play together, then practice simple
steps, and then build from there.



 •  0 comments  •  flag
Share on Twitter
Published on September 16, 2019 15:15