<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>Le blog Dalibo</title>
		<description>DALIBO est le spécialiste français de PostgreSQL. Nous proposons du support, de la formation et du conseil depuis 2005.</description>
		<link>https://blog.dalibo.com/</link>
		<atom:link href="https://blog.dalibo.com/feed.xml" rel="self" type="application/rss+xml" />
		
			<item>
				<title>La double vie de default_statistics_target</title>
				<description>&lt;p&gt;&lt;em&gt;Mont de Marsan, le 10 juillet 2026&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Version améliorée et enrichie de l’article initialement publié le 25 juillet 2025.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Dans &lt;a href=&quot;https://blog.dalibo.com/2024/12/13/10000x_plus_rapide.html&quot;&gt;un précédent
article&lt;/a&gt;, je vous
illustrais à quel point la justesse des statistiques sur les données était
critique pour la performance de vos requêtes. Intéressons-nous aujourd’hui au
paramètre &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;default_statistics_target&lt;/code&gt; et regardons comment il peut nous aider à
améliorer les performances de nos requêtes grâce à des statistiques plus
précises.&lt;/p&gt;

&lt;!--MORE--&gt;

&lt;p&gt;&lt;img src=&quot;/img/portrait_alain2.png&quot; alt=&quot;Alain Lesage&quot; style=&quot;float: right; padding:10px; width:120px;&quot; /&gt;&lt;/p&gt;

&lt;h3 id=&quot;le-principe&quot;&gt;Le principe&lt;/h3&gt;

&lt;p&gt;Pour obtenir les meilleurs plans d’exécution possibles, PostgreSQL a besoin
d’estimer, à chaque étape d’une requête, le nombre de lignes qui seront
manipulées.&lt;/p&gt;

&lt;p&gt;PostgreSQL a aussi besoin d’estimer la taille moyenne de chaque colonne, par
exemple pour déterminer si un tri pourra se faire entièrement en mémoire.&lt;/p&gt;

&lt;h3 id=&quot;léchantillonnage&quot;&gt;L’échantillonnage&lt;/h3&gt;

&lt;p&gt;Pour ce faire, nul besoin de mesurer chacune des lignes de chacune des tables.
Un échantillon assez grand pris aléatoirement est suffisamment représentatif de
l’ensemble. PostgreSQL se base sur &lt;a href=&quot;https://sigmodrecord.org/publications/sigmodRecord/9806/pdfs/276305.276343.pdf&quot;&gt;cette
publication&lt;/a&gt;
de Surajit Chaudhuri, Rajeev Motwani et Vivek Narasayya &lt;em&gt;“Random sampling for
histogram construction: how much is enough?”&lt;/em&gt; de 1998 pour déterminer combien de
lignes suffisent à construire cet échantillon.&lt;/p&gt;

&lt;p&gt;Les développeurs se sont appuyés sur cette étude pour retenir un échantillon de
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;300 × k lignes&lt;/code&gt;, où &lt;em&gt;k&lt;/em&gt; est la « cible statistique » de chaque colonne,
définie globalement par le paramètre &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;default_statistics_target&lt;/code&gt;. Le facteur
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;300&lt;/code&gt; est codé en dur dans le code source de
&lt;a href=&quot;https://github.com/postgres/postgres/blob/master/src/backend/commands/analyze.c&quot;&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;analyze.c&lt;/code&gt;&lt;/a&gt; :&lt;/p&gt;

&lt;div class=&quot;language-c highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;n&quot;&gt;std_typanalyze&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;VacAttrStats&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;stats&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt;…&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;stats&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;minrows&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;300&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;stats&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;attstattarget&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt;…&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;On comprend que la taille de l’échantillon est donc de 300 fois la valeur de
la cible statistique. PostgreSQL utilise donc par défaut un échantillon
de &lt;strong&gt;30 000 lignes&lt;/strong&gt; pour calculer ses statistiques :&lt;/p&gt;

&lt;div class=&quot;language-sql highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;n&quot;&gt;postgres&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=#&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;SHOW&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;default_statistics_target&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;-- nous avons bien la valeur par défaut&lt;/span&gt;
 &lt;span class=&quot;n&quot;&gt;default_statistics_target&lt;/span&gt; 
&lt;span class=&quot;c1&quot;&gt;---------------------------&lt;/span&gt;
 &lt;span class=&quot;mi&quot;&gt;100&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;ligne&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;postgres&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=#&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;ANALYZE&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;VERBOSE&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;matable&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;-- confirmation de la taille de l'échantillon &lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;INFO&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;  &lt;span class=&quot;n&quot;&gt;analyzing&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;&quot;public.matable&quot;&lt;/span&gt;   &lt;span class=&quot;c1&quot;&gt;-- &quot;30000 rows in sample&quot; ci-dessous&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;INFO&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;  &lt;span class=&quot;nv&quot;&gt;&quot;matable&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;scanned&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;7280&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;of&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;7280&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;pages&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;containing&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;990000&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;live&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;rows&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;and&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;dead&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;rows&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;30000&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;rows&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;sample&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;990000&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;estimated&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;total&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;rows&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;ANALYZE&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;Temps&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;376&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;310&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;ms&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;la-résolution&quot;&gt;La résolution&lt;/h3&gt;

&lt;p&gt;Pour chaque colonne, PostgreSQL calcule un certain nombre de statistiques. Elles
peuvent être consultées dans la vue
&lt;a href=&quot;https://docs.postgresql.fr/current/view-pg-stats.html&quot;&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;pg_stats&lt;/code&gt;&lt;/a&gt;. Deux
d’entre elles, la liste des &lt;strong&gt;&lt;em&gt;most common values&lt;/em&gt;&lt;/strong&gt; (MCV) et l’&lt;strong&gt;histogramme&lt;/strong&gt;
des valeurs sont particulièrement importantes.&lt;/p&gt;

&lt;p&gt;Par exemple, une liste MCV pour une colonne &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;prix&lt;/code&gt; d’une table &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;produit&lt;/code&gt;
pourrait avoir
cette forme :&lt;/p&gt;

&lt;div class=&quot;language-sql highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;n&quot;&gt;postgres&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=#&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;SELECT&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;most_common_vals&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;most_common_freqs&lt;/span&gt; 
&lt;span class=&quot;k&quot;&gt;FROM&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;pg_stats&lt;/span&gt; 
&lt;span class=&quot;k&quot;&gt;WHERE&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;attname&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'prix'&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;\&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;gx&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;RECORD&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;c1&quot;&gt;-----+----------------------------------&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;most_common_vals&lt;/span&gt;  &lt;span class=&quot;o&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;99&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;9&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;99&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;19&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;99&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;29&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;99&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;49&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;99&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;most_common_freqs&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;05&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;047&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;03&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Ces cinq prix sont les plus fréquents dans la colonne &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;prix&lt;/code&gt;. 30 % des valeurs
sont égales à 4,99 et 3 % égales à 49,99.&lt;/p&gt;

&lt;p&gt;Pour illustrer la notion d’histogramme, on peut considérer une colonne &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;poids&lt;/code&gt;
d’une table &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;produit&lt;/code&gt; :&lt;/p&gt;

&lt;div class=&quot;language-sql highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;n&quot;&gt;postgres&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=#&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;SELECT&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;histogram_bounds&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;FROM&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;pg_stats&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;WHERE&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;attname&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'poids'&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;\&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;gx&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;RECORD&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;c1&quot;&gt;----+---------------------------&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;histogram_bounds&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;30&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;200&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;600&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1000&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;10000&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Avec ces 6 bornes, notre histogramme dispose de 5 intervalles. L’écart entre les
bornes est ajusté afin que chaque intervalle corresponde sensiblement au même
nombre de lignes. Il y a donc environ autant de produits dont le poids est
compris entre 0 et 30 g que de produits compris entre 1 et 10 kg.&lt;/p&gt;

&lt;p&gt;Mais quelle est la bonne quantité de valeurs fréquentes à retenir pour la liste
MCV ? Et combien d’intervalles doit comporter notre histogramme calculé pour les
valeurs scalaires ? En regardant dans les fonctions &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;compute_distinct_stats()&lt;/code&gt;
et &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;compute_scalar_stats()&lt;/code&gt;, nous observons ces initialisations :&lt;/p&gt;

&lt;div class=&quot;language-c highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;cm&quot;&gt;/* dans compute_distinct_stats() */&lt;/span&gt;
	&lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt;		&lt;span class=&quot;n&quot;&gt;num_mcv&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;stats&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;attstattarget&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

&lt;span class=&quot;cm&quot;&gt;/* dans compute_scalar_stats() */&lt;/span&gt;
	&lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt;		&lt;span class=&quot;n&quot;&gt;num_mcv&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;stats&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;attstattarget&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
	&lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt;		&lt;span class=&quot;n&quot;&gt;num_bins&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;stats&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;attstattarget&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Nous constatons que c’est de nouveau la cible statistique de la colonne
(&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;attstattarget&lt;/code&gt;, égale à &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;default_statistics_target&lt;/code&gt; par défaut) qui est
utilisée. Par défaut, pour chaque colonne de chaque table, la liste MCV
comportera donc jusqu’à 100 valeurs, et l’histogramme jusqu’à 100 intervalles.&lt;/p&gt;

&lt;p&gt;La &lt;strong&gt;cible statistique&lt;/strong&gt; sert aussi et surtout à indiquer une résolution pour
les statistiques, suffisamment élevée pour qu’elles soient précises et utiles,
sans trop l’être pour ne pas pénaliser le temps de planification des requêtes.&lt;/p&gt;

&lt;h3 id=&quot;un-paramètre-deux-fonctions&quot;&gt;Un paramètre, deux fonctions&lt;/h3&gt;

&lt;p&gt;Nous voyons donc que la cible statistique a deux fonctions distinctes
dans la collecte des statistiques par &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ANALYZE&lt;/code&gt;, une pour la taille de
l’échantillon, une autre pour la résolution de certaines statistiques, listes
MCV et histogrammes.&lt;/p&gt;

&lt;p&gt;L’étude citée nous a montré qu’augmenter la taille de l’échantillon n’apporte
que peu d’information supplémentaire à partir d’un certain seuil. En revanche,
la résolution des statistiques peut parfois être insuffisante, surtout pour
l’histogramme, quand on a des valeurs avec une distribution peu régulière, voire
erratique.&lt;/p&gt;

&lt;p&gt;Grâce à un histogramme de meilleure résolution, l’optimiseur pourra se rendre
compte que certains filtres sont plus sélectifs et ajuster le plan d’exécution
en conséquence.&lt;/p&gt;

&lt;h3 id=&quot;exemple&quot;&gt;Exemple&lt;/h3&gt;

&lt;p&gt;Considérons la table &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;mesure&lt;/code&gt; suivante :&lt;/p&gt;

&lt;div class=&quot;language-sql highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;CREATE&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;TABLE&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;mesure&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;id&lt;/span&gt;     &lt;span class=&quot;nb&quot;&gt;SERIAL&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;PRIMARY&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;KEY&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;valeur_a&lt;/span&gt;  &lt;span class=&quot;nb&quot;&gt;NUMERIC&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;valeur_b&lt;/span&gt;  &lt;span class=&quot;nb&quot;&gt;NUMERIC&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;CREATE&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;INDEX&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;idx_valeura&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;ON&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;mesure&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;valeur_a&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;CREATE&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;INDEX&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;idx_valeurb&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;ON&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;mesure&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;valeur_b&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;puis insérons quelques données :&lt;/p&gt;

&lt;div class=&quot;language-sql highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c1&quot;&gt;-- un million de mesures : 80 % concentrées autour des dizaines&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;-- (bandes continues [0,1), [10,11), … [990,991)),&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;-- 20 % de fond uniforme entre 0 et 1000&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;INSERT&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;INTO&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;mesure&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;valeur_a&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;valeur_b&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;SELECT&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;v&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;v&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;FROM&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;SELECT&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;CASE&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;WHEN&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;random&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;8&lt;/span&gt;
              &lt;span class=&quot;k&quot;&gt;THEN&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;floor&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;random&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;10&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;random&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
              &lt;span class=&quot;k&quot;&gt;ELSE&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;random&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1000&lt;/span&gt;
         &lt;span class=&quot;k&quot;&gt;END&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;AS&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;v&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;FROM&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;generate_series&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1000000&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;t&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Ici, les valeurs sont concentrées autour des dizaines, et plus clairsemées entre
les bandes :&lt;/p&gt;

&lt;div class=&quot;language-sql highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;n&quot;&gt;postgres&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=#&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;SELECT&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;count&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;FROM&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;mesure&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;WHERE&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;floor&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;valeur_a&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;10&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
 &lt;span class=&quot;k&quot;&gt;count&lt;/span&gt;  
&lt;span class=&quot;c1&quot;&gt;--------&lt;/span&gt;
 &lt;span class=&quot;mi&quot;&gt;819812&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;ligne&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;postgres&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=#&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;SELECT&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;count&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;FROM&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;mesure&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;WHERE&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;floor&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;valeur_a&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;10&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
 &lt;span class=&quot;k&quot;&gt;count&lt;/span&gt;  
&lt;span class=&quot;c1&quot;&gt;--------&lt;/span&gt;
 &lt;span class=&quot;mi&quot;&gt;180188&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;ligne&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;!--![répartition réelle des valeurs](/img/2025_stats_target_repartition.png)--&gt;
&lt;p&gt;&lt;img src=&quot;/img/2025_stats_target_repartition.png&quot; alt=&quot;répartition réelle : bandes denses aux dizaines, fond clairsemé&quot; style=&quot;width: 800px; max-width: 100%&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Nous définissons une cible statistique de 100 pour la colonne &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;valeur_a&lt;/code&gt; et de
1000 pour &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;valeur_b&lt;/code&gt;. Ceci nous permettra de voir l’impact de la résolution de
l’histogramme entre 100 et 1000 intervalles.&lt;/p&gt;

&lt;div class=&quot;language-sql highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;ALTER&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;TABLE&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;mesure&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;ALTER&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;COLUMN&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;valeur_a&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;SET&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;STATISTICS&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;ALTER&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;TABLE&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;mesure&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;ALTER&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;COLUMN&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;valeur_b&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;SET&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;STATISTICS&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1000&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;À noter que la taille d’échantillon sera de &lt;strong&gt;300 000&lt;/strong&gt; lignes dans les deux
cas :&lt;/p&gt;

&lt;div class=&quot;language-sql highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;n&quot;&gt;postgres&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=#&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;ANALYZE&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;VERBOSE&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;mesure&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;INFO&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;  &lt;span class=&quot;n&quot;&gt;analyzing&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;&quot;public.mesure&quot;&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;INFO&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;  &lt;span class=&quot;nv&quot;&gt;&quot;mesure&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;scanned&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;7353&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;of&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;7353&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;pages&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;containing&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1000000&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;live&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;rows&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;and&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;dead&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;rows&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;300000&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;rows&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;sample&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1000000&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;estimated&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;total&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;rows&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;ANALYZE&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Nous pouvons vérifier la taille des histogrammes :&lt;/p&gt;

&lt;div class=&quot;language-sql highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;n&quot;&gt;postgres&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=#&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;SELECT&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;array_length&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;histogram_bounds&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;FROM&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;pg_stats&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;WHERE&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;tablename&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'mesure'&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;AND&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;attname&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'valeur_a'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;SELECT&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;array_length&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;histogram_bounds&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;FROM&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;pg_stats&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;WHERE&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;tablename&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'mesure'&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;AND&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;attname&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'valeur_b'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
 &lt;span class=&quot;n&quot;&gt;array_length&lt;/span&gt; 
&lt;span class=&quot;c1&quot;&gt;--------------&lt;/span&gt;
          &lt;span class=&quot;mi&quot;&gt;101&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;ligne&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

 &lt;span class=&quot;n&quot;&gt;array_length&lt;/span&gt; 
&lt;span class=&quot;c1&quot;&gt;--------------&lt;/span&gt;
         &lt;span class=&quot;mi&quot;&gt;1001&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;ligne&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Le premier comporte bien 100 intervalles (101 bornes), le second 1000 (1001
bornes), soit la résolution maximale de chaque cible.&lt;/p&gt;

&lt;p&gt;Les illustrations suivantes montrent ce que le planificateur estime de la
répartition des données pour chaque colonne grâce aux histogrammes. Nous
remarquons à quel point l’histogramme sur &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;valeur_b&lt;/code&gt; est plus proche de la
répartition réelle, rappelée en filigrane.&lt;/p&gt;

&lt;!--![vue de l'histogramme à basse résolution](/img/2025_stats_target_vue_cible100.png)--&gt;
&lt;p&gt;&lt;img src=&quot;/img/2025_stats_target_vue_cible100.png&quot; alt=&quot;ce que « voit » l'histogramme à basse résolution : densité quasi uniforme, les bandes réelles en filigrane&quot; style=&quot;width: 800px; max-width: 100%&quot; /&gt;&lt;/p&gt;

&lt;!--![vue de l'histogramme à haute résolution](/img/2025_stats_target_vue_cible1000.png)--&gt;
&lt;p&gt;&lt;img src=&quot;/img/2025_stats_target_vue_cible1000.png&quot; alt=&quot;ce que « voit » l'histogramme à haute résolution : bandes et creux reconstitués&quot; style=&quot;width: 800px; max-width: 100%&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Cherchons maintenant, dans la zone clairsemée entre deux bandes (en orange
ci-dessus), les 100 premières lignes dans l’ordre de la clé primaire (une
pagination classique) :&lt;/p&gt;

&lt;div class=&quot;language-sql highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;EXPLAIN&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;ANALYZE&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;SELECT&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;FROM&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;mesure&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;WHERE&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;valeur_a&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;BETWEEN&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;504&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;AND&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;507&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;ORDER&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;BY&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;LIMIT&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;EXPLAIN&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;ANALYZE&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;SELECT&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;FROM&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;mesure&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;WHERE&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;valeur_b&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;BETWEEN&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;504&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;AND&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;507&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;ORDER&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;BY&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;LIMIT&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;language-sql highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;                               &lt;span class=&quot;n&quot;&gt;QUERY&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;PLAN&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;----------------------------------------------------------------------------------&lt;/span&gt;
 &lt;span class=&quot;k&quot;&gt;Limit&lt;/span&gt;  &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;cost&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;42&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;..&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1277&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;87&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;rows&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;100&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;26&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
        &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;actual&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;time&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;043&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;..&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;15&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;608&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;rows&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;100&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;loops&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
   &lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;  &lt;span class=&quot;k&quot;&gt;Index&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Scan&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;using&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;mesure_pkey&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;on&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;mesure&lt;/span&gt;
             &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;cost&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;42&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;..&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;38336&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;43&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;rows&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;3001&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;26&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
             &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;actual&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;time&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;043&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;..&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;15&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;603&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;rows&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;100&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;loops&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
         &lt;span class=&quot;n&quot;&gt;Filter&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;((&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;valeur_a&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;=&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'504'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;numeric&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;AND&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;valeur_a&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;=&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'507'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;numeric&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;
         &lt;span class=&quot;k&quot;&gt;Rows&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Removed&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;by&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Filter&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;176253&lt;/span&gt;
 &lt;span class=&quot;n&quot;&gt;Planning&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;Time&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;018&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;ms&lt;/span&gt;
 &lt;span class=&quot;n&quot;&gt;Execution&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;Time&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;15&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;615&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;ms&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;6&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;lignes&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

                               &lt;span class=&quot;n&quot;&gt;QUERY&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;PLAN&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;----------------------------------------------------------------------------------&lt;/span&gt;
 &lt;span class=&quot;k&quot;&gt;Limit&lt;/span&gt;  &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;cost&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;2015&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;41&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;..&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;2015&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;66&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;rows&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;100&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;26&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
        &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;actual&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;time&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;488&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;..&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;493&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;rows&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;100&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;loops&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
   &lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;  &lt;span class=&quot;n&quot;&gt;Sort&lt;/span&gt;  &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;cost&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;2015&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;41&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;..&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;2017&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;04&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;rows&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;655&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;26&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
             &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;actual&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;time&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;488&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;..&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;492&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;rows&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;100&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;loops&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
         &lt;span class=&quot;n&quot;&gt;Sort&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;Key&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;id&lt;/span&gt;
         &lt;span class=&quot;n&quot;&gt;Sort&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;Method&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;top&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;N&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;heapsort&lt;/span&gt;  &lt;span class=&quot;n&quot;&gt;Memory&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;32&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;kB&lt;/span&gt;
         &lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;  &lt;span class=&quot;n&quot;&gt;Bitmap&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Heap&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Scan&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;on&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;mesure&lt;/span&gt;  &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;cost&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;19&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;14&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;..&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1990&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;37&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;rows&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;655&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;26&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
                                         &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;actual&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;time&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;098&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;..&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;455&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;rows&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;615&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;loops&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
               &lt;span class=&quot;k&quot;&gt;Recheck&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Cond&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;((&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;valeur_b&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;=&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'504'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;numeric&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;AND&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;valeur_b&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;=&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'507'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;numeric&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;
               &lt;span class=&quot;n&quot;&gt;Heap&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Blocks&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;exact&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;584&lt;/span&gt;
               &lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;  &lt;span class=&quot;n&quot;&gt;Bitmap&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;Index&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Scan&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;on&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;idx_valeurb&lt;/span&gt;  &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;cost&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;00&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;..&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;18&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;98&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;rows&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;655&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
                                                     &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;actual&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;time&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;053&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;..&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;053&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;rows&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;615&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;loops&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
                     &lt;span class=&quot;k&quot;&gt;Index&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Cond&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;((&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;valeur_b&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;=&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'504'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;numeric&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;AND&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;valeur_b&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;=&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'507'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;numeric&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;
 &lt;span class=&quot;n&quot;&gt;Planning&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;Time&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;095&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;ms&lt;/span&gt;
 &lt;span class=&quot;n&quot;&gt;Execution&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;Time&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;502&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;ms&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;11&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;lignes&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Les deux colonnes contiennent les mêmes données : l’intervalle renferme en
réalité &lt;strong&gt;615&lt;/strong&gt; lignes (visibles dans le second plan). L’histogramme à haute
résolution de &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;valeur_b&lt;/code&gt; fournit une estimation de &lt;strong&gt;655&lt;/strong&gt;, très proche du réel,
là où l’histogramme à basse résolution de &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;valeur_a&lt;/code&gt; sur-estime à &lt;strong&gt;3001&lt;/strong&gt;.
Certains intervalles de l’histogramme à basse résolution couvrent à la fois des
bandes denses et des zones clairsemées. Le planificateur suppose que les lignes
sont uniformément réparties sur la largeur de l’intervalle, ce qui n’est pas le
cas et le conduit à choisir un plan sous-optimal.&lt;/p&gt;

&lt;p&gt;Pour produire un résultat trié par &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;id&lt;/code&gt;, le planificateur hésite donc entre deux
stratégies : parcourir la table dans l’ordre de la clé primaire en filtrant au
passage, quitte à s’arrêter dès la centième ligne trouvée, ou bien récupérer
toutes les lignes de l’intervalle via l’index sur la valeur, puis les trier. Le
coût de la première stratégie dépend directement de l’estimation : plus
l’intervalle semble peuplé, plus le planificateur pense s’arrêter tôt. Avec
une estimation à 3001 lignes, il espère trouver ses 100 lignes après avoir parcouru et filtré une faible fraction de l’index sur clé primaire.
Inversement, le &lt;em&gt;bitmap index scan&lt;/em&gt; suivi d’un tri lui paraît plus coûteux qu’il ne l’est en réalité, car il estime plus de lecture hors cache. Sur
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;valeur_b&lt;/code&gt;, avec une meilleure information, il choisira le meilleur plan.&lt;/p&gt;

&lt;p&gt;Le premier plan balaye et rejette plus de 176 000 lignes avant de réunir ses 100
lignes : 15,6 ms, contre 0,5 ms pour le second, une trentaine de fois plus rapide (hors cache, l’écart se resserre autour d’un facteur 2, les deux plans ayant alors un coût I/O non négligeable). Même requête, mêmes données, &lt;strong&gt;même taille d’échantillon&lt;/strong&gt; : seule la
résolution de l’histogramme diffère.&lt;/p&gt;

&lt;h3 id=&quot;à-retenir&quot;&gt;À retenir&lt;/h3&gt;

&lt;p&gt;Augmenter la cible statistique permet d’obtenir des statistiques de meilleure
qualité, et donc de meilleures performances, au prix d’un &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ANALYZE&lt;/code&gt;/autoanalyze
plus coûteux et d’un temps de planification légèrement plus élevé. Il est donc
généralement préférable d’augmenter cette cible colonne par colonne, plutôt que
globalement avec &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;default_statistics_target&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Pour aller plus loin, je vous invite à revoir la conférence &lt;a href=&quot;https://youtu.be/HI7AIcwNI2w?si=XUTX3_gCHElIa6Tv&quot;&gt;&lt;em&gt;Voyage au centre
des statistiques&lt;/em&gt;&lt;/a&gt; de Louise
Leinweber à PGDay FR 2025. Nos formations &lt;a href=&quot;https://dali.bo/devpg_html&quot;&gt;DEVPG&lt;/a&gt; et
&lt;a href=&quot;https://dali.bo/perf1_html&quot;&gt;PERF1&lt;/a&gt; incluent aussi depuis cette année un nouveau
module dédié à la compréhension des statistiques utilisées par le planificateur
de PostgreSQL.&lt;/p&gt;
</description>
				<pubDate>Fri, 10 Jul 2026 00:00:00 -0500</pubDate>
				<link>https://blog.dalibo.com/2026/07/10/statistics-target.html</link>
				<guid isPermaLink="true">https://blog.dalibo.com/2026/07/10/statistics-target.html</guid>
			</item>
		
			<item>
				<title>ldap2pg 6.6 avec GSSAPI</title>
				<description>&lt;p&gt;&lt;em&gt;Paris, le 7 juillet 2026&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Dalibo vous annonce la disponibilité de ldap2pg 6.6.
Cette version apporte l’authentification GSSAPI/Kerberos avec l’annuaire de synchronisation,
le support de PostgreSQL 19 beta et quelques correctifs.
Suivez la &lt;a href=&quot;https://ldap2pg.readthedocs.io/en/latest/install/&quot;&gt;documentation pour installer&lt;/a&gt; cette nouvelle version.&lt;/p&gt;

&lt;!--MORE--&gt;

&lt;p&gt;&lt;img src=&quot;https://github.com/dalibo/ldap2pg/raw/master/docs/img/logo-phrase.png&quot; alt=&quot;ldap2pg&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Depuis 2017, ldap2pg propose la meilleure solution de synchronisation automatique de rôles et de privilèges pour PostgreSQL.
Configurez l’authentification LDAP dans le fichier &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;pg_hba.conf&lt;/code&gt;
puis utilisez ldap2pg pour créer et configurer les rôles depuis votre annuaire d’entreprise.&lt;/p&gt;

&lt;h3 id=&quot;gssapikerberos&quot;&gt;GSSAPI/Kerberos&lt;/h3&gt;

&lt;p&gt;ldap2pg implémente désormais l’authentification GSSAPI/Kerberos pour une configuration sans secret pour l’accès à l’annuaire de synchronisation.
L’authentification GSSAPI est un nouveau mécanisme SASL disponible à côté de &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;DIGEST-MD5&lt;/code&gt;.
Ce mécanisme se configure comme ldaputils avec une subtile différence: le chiffrement GSSAPI est automatiquement désactivé si la connexion est déjà chiffrée avec TLS.&lt;/p&gt;

&lt;h3 id=&quot;divers-correctifs&quot;&gt;Divers correctifs&lt;/h3&gt;

&lt;p&gt;Certaines erreurs de configuration ou de synchronisation sont corrigées.
Le chargement de configuration historique de ldap2pg 5.9 déclenchera des erreurs pour prévenir des configurations incohérentes.
Une erreur de déduplication entraînait la double création de rôles absents, c’est désormais corrigé.
Cette version 6.6 apporte donc plus de stabilité et de fiabilité à l’administration.&lt;/p&gt;

&lt;h3 id=&quot;autres-changements&quot;&gt;Autres changements&lt;/h3&gt;

&lt;p&gt;En avant première,
ldap2pg 6.6 est testé sur PostgreSQL 19 beta, sans souci.
Enfin, l’image Docker est à nouveau disponible.&lt;/p&gt;

&lt;p&gt;Retrouvez la documentation en anglais, des procédures et le support communautaire à ces adresses :&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://ldap2pg.readthedocs.io/en/latest/changelog/#ldap2pg-660&quot;&gt;Documentation des changements&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;Documentation en ligne : &lt;a href=&quot;https://ldap2pg.rtfd.io/en/latest/&quot;&gt;http://ldap2pg.rtfd.io/en/latest/&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;Le projet sur GitHub : &lt;a href=&quot;https://github.com/dalibo/ldap2pg&quot;&gt;https://github.com/dalibo/ldap2pg&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;hr /&gt;

&lt;p&gt;&lt;strong&gt;Étienne BERSAC et Pierre-Louis GONON développent ldap2pg,
un projet du &lt;a href=&quot;https://labs.dalibo.com/&quot;&gt;Dalibo Labs&lt;/a&gt;.
Pour toutes questions techniques,
l’équipe recommande d’utiliser la page de &lt;a href=&quot;https://github.com/dalibo/ldap2pg/discussions&quot;&gt;ldap2pg sur GitHub&lt;/a&gt;.&lt;/strong&gt;&lt;/p&gt;
</description>
				<pubDate>Tue, 07 Jul 2026 00:00:00 -0500</pubDate>
				<link>https://blog.dalibo.com/2026/07/07/ldap2pg-6.6.html</link>
				<guid isPermaLink="true">https://blog.dalibo.com/2026/07/07/ldap2pg-6.6.html</guid>
			</item>
		
			<item>
				<title>ldap2pg 6.6 with GSSAPI</title>
				<description>&lt;p&gt;&lt;em&gt;Paris, July 7, 2026&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Dalibo is pleased to announce the release of ldap2pg 6.6.
This version brings GSSAPI/Kerberos authentication with the synchronization directory,
support for PostgreSQL 19 beta, and a few bug fixes.
Follow the &lt;a href=&quot;https://ldap2pg.readthedocs.io/en/latest/install/&quot;&gt;installation documentation&lt;/a&gt; to install this new version.&lt;/p&gt;

&lt;!--MORE--&gt;

&lt;p&gt;&lt;img src=&quot;https://github.com/dalibo/ldap2pg/raw/master/docs/img/logo-phrase.png&quot; alt=&quot;ldap2pg&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Since 2017, ldap2pg has offered the best solution for automatically synchronizing roles and privileges for PostgreSQL.
Configure LDAP authentication in the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;pg_hba.conf&lt;/code&gt; file,
then use ldap2pg to create and configure roles from your corporate directory.&lt;/p&gt;

&lt;h3 id=&quot;gssapikerberos&quot;&gt;GSSAPI/Kerberos&lt;/h3&gt;

&lt;p&gt;ldap2pg now implements GSSAPI/Kerberos authentication for a secretless configuration when accessing the synchronization directory.
GSSAPI authentication is a new SASL mechanism available alongside &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;DIGEST-MD5&lt;/code&gt;.
This mechanism is configured like ldaputils, with one subtle difference: GSSAPI encryption is automatically disabled if the connection is already encrypted with TLS.&lt;/p&gt;

&lt;h3 id=&quot;various-fixes&quot;&gt;Various Fixes&lt;/h3&gt;

&lt;p&gt;Some configuration and synchronization errors have been fixed.
Loading legacy ldap2pg 5.9 configuration will now trigger errors to prevent inconsistent configurations.
A deduplication bug caused missing roles to be created twice; this is now fixed.
Version 6.6 therefore brings greater stability and reliability to administration.&lt;/p&gt;

&lt;h3 id=&quot;other-changes&quot;&gt;Other Changes&lt;/h3&gt;

&lt;p&gt;As a sneak peek,
ldap2pg 6.6 has been tested against PostgreSQL 19 beta without any issues.
Finally, the Docker image is available again.&lt;/p&gt;

&lt;p&gt;Find the English documentation, guides, and community support at these addresses:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://ldap2pg.readthedocs.io/en/latest/changelog/#ldap2pg-660&quot;&gt;Changelog documentation&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;Online documentation: &lt;a href=&quot;https://ldap2pg.rtfd.io/en/latest/&quot;&gt;http://ldap2pg.rtfd.io/en/latest/&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;The project on GitHub: &lt;a href=&quot;https://github.com/dalibo/ldap2pg&quot;&gt;https://github.com/dalibo/ldap2pg&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;hr /&gt;

&lt;p&gt;&lt;strong&gt;Étienne BERSAC and Pierre-Louis GONON develop ldap2pg,
a &lt;a href=&quot;https://labs.dalibo.com/&quot;&gt;Dalibo Labs&lt;/a&gt; project.
For any technical questions,
the team recommends using the &lt;a href=&quot;https://github.com/dalibo/ldap2pg/discussions&quot;&gt;ldap2pg page on GitHub&lt;/a&gt;.&lt;/strong&gt;&lt;/p&gt;
</description>
				<pubDate>Tue, 07 Jul 2026 00:00:00 -0500</pubDate>
				<link>https://blog.dalibo.com/2026/07/07/ldap2pg-6.6-en.html</link>
				<guid isPermaLink="true">https://blog.dalibo.com/2026/07/07/ldap2pg-6.6-en.html</guid>
			</item>
		
			<item>
				<title>pgBackRest plugin for CloudNativePG</title>
				<description>&lt;p&gt;&lt;em&gt;Lyon, June 25th, 2026&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;At Dalibo we are actively working on a &lt;a href=&quot;https://github.com/dalibo/cnpg-plugin-pgbackrest&quot;&gt;pgBackRest plugin&lt;/a&gt; for PostgreSQL clusters deployed with
CloudNativePG. Here is the announcement of the 0.0.3 version that has just been
released.&lt;/p&gt;

&lt;!--MORE--&gt;

&lt;p&gt;&lt;img src=&quot;/img/cnpg-header.png&quot; alt=&quot;moteur&quot; /&gt;&lt;/p&gt;

&lt;h3 id=&quot;backup-tools&quot;&gt;Backup tools&lt;/h3&gt;

&lt;p&gt;The PostgreSQL ecosystem is full of tools in various areas. For physical
backups, two tools are primarily used by administrators in addition to 
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;pg_basebackup&lt;/code&gt; tool: Barman and pgBackRest.&lt;/p&gt;

&lt;p&gt;CloudNativePG relies, by default, on Barman to create and restore physical
backups and also archive WAL files. More specifically, it is based on
barman-cloud suite from the Barman project.&lt;/p&gt;

&lt;p&gt;The strength of PostgreSQL lies in the plurality and free choice of tools within
its wide ecosystem.&lt;/p&gt;

&lt;p&gt;We do love pgBackRest for bare metal or virtualized environments and wanted to
see this tool also available for CloudNativePG.&lt;/p&gt;

&lt;p&gt;People behind CloudNativePG allow new tools to be easily plugged thanks to the
&lt;a href=&quot;https://github.com/cloudnative-pg/cnpg-i&quot;&gt;CNPG-I&lt;/a&gt; project. And here we are with
pgBackRest.&lt;/p&gt;

&lt;h3 id=&quot;our-plugin&quot;&gt;Our plugin&lt;/h3&gt;

&lt;p&gt;For some time now, we have been developing a plugin based on pgBackRest to
manage backups of our clusters. The plugin is, of course, open source and can be
found on our GitHub page right here
&lt;a href=&quot;https://github.com/dalibo/cnpg-plugin-pgbackrest&quot;&gt;https://github.com/dalibo/cnpg-plugin-pgbackrest&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;What we are trying to do is offer an alternative based on a well-known and
recognized tool.&lt;/p&gt;

&lt;p&gt;Version 0.0.3 of the plugin is now available. Here’s what you can do with it:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;WALs archiving (using pgBackRest async feature)&lt;/li&gt;
  &lt;li&gt;Taking and restoring backup (on S3 solutions or Azure Blob Storage)&lt;/li&gt;
  &lt;li&gt;Point-in-Time Recovery&lt;/li&gt;
  &lt;li&gt;Creating secondary based on Log Shipping&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;As you’ve probably guessed, this is an experimental plugin. We would be very
happy to receive feedback from your tests to improve what we already did.&lt;/p&gt;

&lt;p&gt;Have a look at the project, the
&lt;a href=&quot;https://plugin-pgbackrest.readthedocs.io/en/latest/&quot;&gt;documentation&lt;/a&gt; and feel
free to test it !&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Any questions ? &lt;a href=&quot;mailto:pierrick.chovelon@dalibo.com?subject=[Commentaire-Blog] pgBackRest plugin&quot;&gt;Send us an email!&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
</description>
				<pubDate>Thu, 25 Jun 2026 00:00:00 -0500</pubDate>
				<link>https://blog.dalibo.com/2026/06/25/plugin-pgbackrest.html</link>
				<guid isPermaLink="true">https://blog.dalibo.com/2026/06/25/plugin-pgbackrest.html</guid>
			</item>
		
			<item>
				<title>pgBackRest : une réponse communautaire</title>
				<description>&lt;p&gt;&lt;em&gt;Paris, le 25 juin 2026&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Le 27 avril dernier, les utilisateurs et contributeurs de PostgreSQL ont été surpris d’apprendre l’interruption du développement et de la maintenance de &lt;strong&gt;pgBackRest&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Heureusement, la communauté s’est rapidement mobilisée pour en permettre la continuité, et au-delà, la pérennité.&lt;/p&gt;

&lt;!--MORE--&gt;

&lt;h3 id=&quot;rappel--ce-quest-pgbackrest&quot;&gt;Rappel : ce qu’est pgBackRest&lt;/h3&gt;

&lt;p&gt;&lt;a href=&quot;https://pgbackrest.org/&quot;&gt;pgBackRest&lt;/a&gt; est un outil de sauvegarde et restauration pour PostgreSQL développé par David Steele sous la &lt;a href=&quot;https://opensource.org/license/mit&quot;&gt;licence MIT&lt;/a&gt;. Son succès technique est tel qu’il reste l’un des outils les plus recommandés.&lt;/p&gt;

&lt;p&gt;David Steele était néanmoins le seul mainteneur du projet à assurer la correction des bugs, la revue des PR et le développement de nouvelles fonctionnalités, rémunéré par Crunchy Data jusqu’à son rachat par Snowflake en juin 2025.&lt;/p&gt;

&lt;p&gt;Déclarant n’avoir trouvé aucun autre employeur pour prendre financièrement en charge ce temps de contribution, &lt;a href=&quot;https://www.linkedin.com/posts/davidsteele_after-a-lot-of-thought-i-have-decided-to-share-7454442611911655424-mVMS&quot;&gt;il annonce la fin de pgBackRest&lt;/a&gt; fin avril, avant de proposer que le projet soit repris par d’autres via un &lt;em&gt;fork&lt;/em&gt; sous un autre nom, c’est-à-dire une copie du code permettant de continuer son développement indépendamment du projet originel.&lt;/p&gt;

&lt;p&gt;Heureusement, plusieurs membres de la communauté se sont rapidement mobilisés auprès de David Steele pour tenter d’organiser la continuité de pgBackRest.&lt;/p&gt;

&lt;h3 id=&quot;une-réponse-communautaire&quot;&gt;Une réponse communautaire&lt;/h3&gt;

&lt;p&gt;Depuis mai, la réponse se fait sur 3 niveaux : technique, financier et organisationnel.&lt;/p&gt;

&lt;p&gt;Techniquement, une transition est en cours afin de renforcer la maintenance de pgBackRest : un second mainteneur devrait arriver, de sorte que David Steele n’en porterait plus seul la responsabilité.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/img/pgbackrest_sponsors.png&quot; alt=&quot;Les sponsors de pgBackRest au 23 juin 2026&quot; style=&quot;float: right; padding: 10px; width: 400px;&quot; /&gt;
Financièrement, le projet bénéficiera d’un soutien structuré autour d’une &lt;a href=&quot;https://pgbackrest.org/news.html#will-continue&quot;&gt;coalition de sponsors&lt;/a&gt; soucieux de l’avenir des projets open source dont dépend une partie de leurs services.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Dès aujourd’hui, Dalibo fait partie de cette coalition.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Sur le plan de la gouvernance, l’option de recourir à une fondation est actuellement à l’étude, nous en saurons probablement plus dans les semaines ou mois qui viennent.&lt;/p&gt;

&lt;p&gt;Cette initiative collective est une très bonne nouvelle pour tout l’écosystème PostgreSQL, pour les fournisseurs de services comme pour les utilisateurs de pgBackRest. Elle offre à l’outil la stabilité dont il a besoin à long terme.&lt;/p&gt;

&lt;h3 id=&quot;dalibo-au-delà-du-soutien-financier&quot;&gt;Dalibo, au-delà du soutien financier&lt;/h3&gt;

&lt;p&gt;&lt;img src=&quot;/img/2026_pgdayfr.jpeg&quot; alt=&quot;Dalibo au PG Day France 2026&quot; style=&quot;float: right; padding: 10px; width: 400px;&quot; /&gt;
Rappelons quelques actions concrètes qui témoignent de l’engagement communautaire de notre entreprise depuis sa création en 2005 :&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;contributions au code de projets externes avec du &lt;a href=&quot;https://dali.bo/temps_ccc&quot;&gt;temps dédié&lt;/a&gt; pour nos équipes ;&lt;/li&gt;
  &lt;li&gt;publication du code de toutes nos productions sous licences libres (Cf. notre &lt;a href=&quot;https://dali.bo/labs&quot;&gt;Dalibo Labs&lt;/a&gt;) ;&lt;/li&gt;
  &lt;li&gt;documentation, &lt;a href=&quot;https://dali.bo/202605_manuels&quot;&gt;manuels&lt;/a&gt; et supports de formation diffusés sous licence CC‑BY‑NC‑SA ;&lt;/li&gt;
  &lt;li&gt;présentations des nouveautés logicielles, démos et retours d’expérience &lt;a href=&quot;https://dali.bo/dalibo_youtube&quot;&gt;partagés publiquement&lt;/a&gt;, y compris lors de notre propre événement annuel PGSession ;&lt;/li&gt;
  &lt;li&gt;sponsorat régulier d’événements communautaires, Dalibo est d’ailleurs l’un des &lt;a href=&quot;https://www.postgresql.org/about/contributing/&quot;&gt;Major Sponsors&lt;/a&gt; de PostgreSQL.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Le logiciel libre fait partie de notre ADN, à travers nos produits comme à travers notre politique de sponsorat, nos pratiques de travail et notre comportement commercial.&lt;/p&gt;

&lt;p&gt;C’est une conviction forte que nous portons fièrement depuis plus de 20 ans, au sein d’une communauté dynamique.&lt;/p&gt;

&lt;p&gt;L’équipe Dalibo&lt;/p&gt;

</description>
				<pubDate>Thu, 25 Jun 2026 00:00:00 -0500</pubDate>
				<link>https://blog.dalibo.com/2026/06/25/pgbackrest_communautaire.html</link>
				<guid isPermaLink="true">https://blog.dalibo.com/2026/06/25/pgbackrest_communautaire.html</guid>
			</item>
		
			<item>
				<title>PGSession 19 : appel à conférences</title>
				<description>&lt;p&gt;&lt;em&gt;Saint-Étienne, le 23 juin 2026&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;La PGSession 19, c’est pas pour tout de suite ! Mais bien que la journée Conférences aura lieu le 13 janvier 2027, nous lançons dès aujourd’hui notre &lt;strong&gt;appel à conférences&lt;/strong&gt;.&lt;/p&gt;

&lt;!--MORE--&gt;
&lt;p&gt;&lt;img src=&quot;/img/pgsession19.png&quot; alt=&quot;Logo PGSession 19&quot; /&gt;&lt;/p&gt;

&lt;h3 id=&quot;la-pgsession-19&quot;&gt;La PGSession 19&lt;/h3&gt;

&lt;p&gt;Comme &lt;a href=&quot;https://blog.dalibo.com/2025/09/18/pgsession_18.html&quot;&gt;annoncé&lt;/a&gt; la semaine dernière, la PGSession 19 se déroulera sur deux journées :&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;Journée Ateliers&lt;/strong&gt; : mardi 12 janvier 2027, à l’&lt;a href=&quot;https://espace-batignolles.com/&quot;&gt;Espace Batignolles&lt;/a&gt;,&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;Journée Conférences&lt;/strong&gt; : mercredi 13 janvier 2027, au &lt;a href=&quot;https://pan-piper.com/&quot;&gt;Pan Piper&lt;/a&gt;.&lt;/p&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Les présentations ainsi que les échanges avec le public seront retransmis en direct sur &lt;a href=&quot;https://dali.bo/2027_site_pgsessions&quot;&gt;pgsessions.com&lt;/a&gt;.&lt;/p&gt;

&lt;h3 id=&quot;lappel-à-conférences&quot;&gt;L’appel à conférences&lt;/h3&gt;

&lt;p&gt;Merci de bien vouloir nous envoyer vos propositions d’intervention &lt;strong&gt;avant Jeudi 29 octobre 2026&lt;/strong&gt; à &lt;a href=&quot;mailto:contact@pgsessions.com?subject=[appel à conférences] proposition&quot;&gt;contact@pgsessions.com&lt;/a&gt; en nous communiquant les éléments suivants :&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Nom, Prénom&lt;/li&gt;
  &lt;li&gt;Compte personnel LinkedIn, X et/ou Mastodon&lt;/li&gt;
  &lt;li&gt;Employeur, fonction&lt;/li&gt;
  &lt;li&gt;Biographie et éventuelles contributions à la communauté PostgreSQL&lt;/li&gt;
  &lt;li&gt;Titre de votre conférence&lt;/li&gt;
  &lt;li&gt;Résumé&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Chaque présentation doit durer &lt;strong&gt;30 minutes&lt;/strong&gt;. Elle sera suivie d’environ 10 minutes d’échange avec le public.&lt;/p&gt;

&lt;p&gt;Les thématiques (&lt;em&gt;liste non exhaustive&lt;/em&gt;) :&lt;/p&gt;

&lt;div style=&quot;float: left; width: 50%; padding-right: 10px;&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;Nouveautés d’un logiciel satellite&lt;/li&gt;
    &lt;li&gt;Industrialisation&lt;/li&gt;
    &lt;li&gt;Migration vers PostgreSQL&lt;/li&gt;
    &lt;li&gt;Performances&lt;/li&gt;
    &lt;li&gt;Protection des données&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;

&lt;div style=&quot;float: left; width: 50%; padding-right: 10px;&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;Sauvegarde et restauration&lt;/li&gt;
    &lt;li&gt;Haute disponibilité&lt;/li&gt;
    &lt;li&gt;Modélisation et développement&lt;/li&gt;
    &lt;li&gt;Communauté PostgreSQL et contributions&lt;/li&gt;
    &lt;li&gt;Etc.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;

&lt;div style=&quot;clear: both&quot;&gt;&lt;/div&gt;

&lt;p&gt;Les interventions peuvent prendre plusieurs formes : retour d’expérience, témoignage utilisateur, preuve de concept, tutoriel, étude comparative, etc.&lt;/p&gt;

&lt;p&gt;Comme dit plus haut, cette journée sera &lt;strong&gt;visible en direct&lt;/strong&gt; sur &lt;a href=&quot;https://dali.bo/2027_site_pgsessions&quot;&gt;pgsessions.com&lt;/a&gt;, puis diffusée sur la &lt;a href=&quot;https://dali.bo/dalibo_youtube&quot;&gt;chaîne Youtube de Dalibo&lt;/a&gt; pendant 10 ans. &lt;em&gt;En nous proposant une conférence, vous acceptez sa captation audio/vidéo et vous nous autorisez à utiliser votre image en renonçant à tout droit de compensation pour cela&lt;/em&gt;.&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;&lt;strong&gt;À propos de la PGSession :&lt;/strong&gt;
Depuis 2008, la PGSession est un événement annuel organisé par Dalibo. Dans une ambiance conviviale, elle vous permet de découvrir des projets et de rencontrer le staff technique et commercial de Dalibo, ainsi que d’autres membres de la communauté PostgreSQL. À partir de 2018 où elle a célébré ses 10 ans, la PGSession se déploie sur deux journées : une première réservée à des ateliers, et une seconde dédiée aux conférences.&lt;/p&gt;
</description>
				<pubDate>Tue, 23 Jun 2026 00:00:00 -0500</pubDate>
				<link>https://blog.dalibo.com/2026/06/23/pgsession19_cfp.html</link>
				<guid isPermaLink="true">https://blog.dalibo.com/2026/06/23/pgsession19_cfp.html</guid>
			</item>
		
			<item>
				<title>PGSession 19 : rendez-vous les 12 et 13 janvier 2027 à Paris</title>
				<description>&lt;p&gt;&lt;em&gt;Saint-Étienne, le 11 juin 2026&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;À vos agendas ! La prochaine PGSession aura lieu les &lt;strong&gt;12 et 13 janvier 2027 à Paris&lt;/strong&gt;. L’appel à conférences sera prochainement lancé, tandis que les inscriptions débuteront en octobre.&lt;/p&gt;

&lt;!--MORE--&gt;

&lt;p&gt;&lt;img src=&quot;/img/pgsession19.png&quot; alt=&quot;Logo PGSession 19&quot; /&gt;&lt;/p&gt;

&lt;h3 id=&quot;rappel--ce-quest-la-pgsession&quot;&gt;Rappel : ce qu’est la PGSession&lt;/h3&gt;

&lt;p&gt;D’inspiration communautaire, l’événement annuel de Dalibo se déroule sur deux journées consécutives : les &lt;strong&gt;Ateliers&lt;/strong&gt; et les &lt;strong&gt;Conférences&lt;/strong&gt;. Vous êtes libre de participer à l’une, à l’autre ou aux deux.&lt;/p&gt;

&lt;p&gt;Lors de la PGSession, les acteurs de l’écosystème PostgreSQL francophone peuvent partager et enrichir leurs connaissances, tout en rencontrant des membres de la communauté dans une ambiance conviviale.&lt;/p&gt;

&lt;p&gt;Nos DBA consultants et nos développeurs sont au rendez-vous pour mettre en avant leurs travaux. Vous pouvez également échanger avec notre équipe commerciale sur vos besoins et nos services, ainsi qu’avec d’autres membres du personnel mobilisés pour vous accueillir.&lt;/p&gt;

&lt;h3 id=&quot;mardi-12-janvier--les-ateliers&quot;&gt;Mardi 12 janvier : les Ateliers&lt;/h3&gt;

&lt;p&gt;En vous inscrivant à partir d’octobre prochain, vous pourrez &lt;strong&gt;choisir deux ateliers&lt;/strong&gt; de trois heures chacun, parmi les quatre proposés.&lt;/p&gt;

&lt;p&gt;Tous seront animés en binôme par nos DBA et et nos développeurs.&lt;/p&gt;

&lt;p&gt;Vous approfondirez non seulement vos connaissances sur des thématiques telles que la migration, l’anonymisation ou les performances, mais vous découvrirez aussi certains projets de développement internes à Dalibo.&lt;/p&gt;

&lt;p&gt;Quel que soit le sujet, vous pourrez vous exercer lors des travaux pratiques.&lt;/p&gt;

&lt;h3 id=&quot;mercredi-13-janvier--les-conférences&quot;&gt;Mercredi 13 janvier : les Conférences&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;/img/pgsession18_pirlgon.jpg&quot; alt=&quot;La PGSession 18, en 2026&quot; style=&quot;float: right; padding:10px; width:350px;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Si cette seconde journée commencera par la présentation des &lt;strong&gt;nouveautés&lt;/strong&gt; de la dernière version majeure de PostgreSQL, elle abordera ensuite le SGBD sous les angles du développement, de l’administration, et des projets au sein des organisations.&lt;/p&gt;

&lt;p&gt;Au menu, des retours d’expériences, des témoignages utilisateurs, des démos, des études comparatives, etc.&lt;/p&gt;

&lt;p&gt;L’&lt;strong&gt;appel à conférences&lt;/strong&gt; sera lancé le 23 juin, tandis que le programme sera publié fin octobre.&lt;/p&gt;

&lt;p&gt;Pour le public à distance, les conférences seront captées et retransmises en direct sur le &lt;a href=&quot;https://dali.bo/2027_site_pgsessions&quot;&gt;site des pgsessions&lt;/a&gt;, où un tchat éphémère vous permettra de poser des questions.&lt;/p&gt;

&lt;h3 id=&quot;comment-vous-informer&quot;&gt;Comment vous informer&lt;/h3&gt;

&lt;p&gt;Pour ne manquer aucune information sur l’événement, retrouvez-nous sur nos réseaux sociaux avec le mot-clé #pgsession19 :&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.linkedin.com/company/dalibo&quot;&gt;LinkedIn&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://mastodon.online/@dalibo&quot;&gt;Mastodon&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Vous pourrez également demander à recevoir notre newsletter PGSessions en nous écrivant à contact@pgsessions.com.&lt;/p&gt;

&lt;p&gt;En attendant, les conférences passées et leurs supports de présentation sont toujours en libre accès sur le &lt;a href=&quot;https://dali.bo/pgsessions_archives&quot;&gt;site des
PGSessions&lt;/a&gt; ou sur notre &lt;a href=&quot;https://dali.bo/dalibo_youtube&quot;&gt;chaîne YouTube&lt;/a&gt; !&lt;/p&gt;

&lt;p&gt;L’équipe PGSession 19&lt;/p&gt;

</description>
				<pubDate>Thu, 11 Jun 2026 00:00:00 -0500</pubDate>
				<link>https://blog.dalibo.com/2026/06/11/pgsession_19.html</link>
				<guid isPermaLink="true">https://blog.dalibo.com/2026/06/11/pgsession_19.html</guid>
			</item>
		
			<item>
				<title>Plongez dans le monde de CloudNativePG #12 - Mise à jour dynamique de pg_hba.conf</title>
				<description>&lt;p&gt;&lt;em&gt;Lyon, le 28 mai 2026&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;CloudNativePG&lt;/strong&gt; ou comment embarquer un éléphant sur un porte-conteneurs !&lt;/p&gt;

&lt;p&gt;La configuration d’une instance PostgreSQL, où qu’elle soit déployée, nécessite
d’être faite. La configuration des règles d’accès dans &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;pg_hba.conf&lt;/code&gt; est
essentielle. Regardons une nouveauté de la version 1.29 de l’opérateur qui
permet de reconfigurer dynamiquement ce fichier.&lt;/p&gt;

&lt;!--MORE--&gt;

&lt;p&gt;&lt;img src=&quot;/img/cnpg-header.png&quot; alt=&quot;moteur&quot; /&gt;&lt;/p&gt;

&lt;h3 id=&quot;rappel-sur-pg_hbaconf&quot;&gt;Rappel sur pg_hba.conf&lt;/h3&gt;

&lt;p&gt;L’authentification à une instance est paramétrée au moyen de ce fichier. 
Lorsque le serveur PostgreSQL reçoit une demande de connexion, il connaît le
type de connexion utilisé par le client (socket Unix, connexion TCP SSL,
connexion TCP simple, etc.). Il connaît aussi l’adresse IP du client (dans le
cas d’une connexion via une socket TCP), le nom de la base et celui de
l’utilisateur. En fonction des règles présentes et de la méthode
d’authentification indiquée, le client est autorisé, ou non, à se connecter.&lt;/p&gt;

&lt;p&gt;Une instance déployée avec CloudNativePG voit son fichier &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;pg_hba.conf&lt;/code&gt; être
pré-configuré. Il est possible de trouver les règles actuellement définies avec
la requête SQL suivante :&lt;/p&gt;

&lt;div class=&quot;language-sql highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;select&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;database&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;user_name&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;address&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;netmask&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;auth_method&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;pg_hba_file_rules&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;language-console highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;go&quot;&gt;  type   |   database    |        user_name        | address | netmask |  auth_method  
---------+---------------+-------------------------+---------+---------+---------------
 local   | {all}         | {cnpg_metrics_exporter} |         |         | peer
 local   | {all}         | {all}                   |         |         | peer
 hostssl | {postgres}    | {streaming_replica}     | all     |         | cert
 hostssl | {replication} | {streaming_replica}     | all     |         | cert
 hostssl | {all}         | {cnpg_pooler_pgbouncer} | all     |         | cert
 host    | {all}         | {all}                   | all     |         | scram-sha-256
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;La dernière ligne indique que toutes les demandes de connexion à l’instance
faites par n’importe quel utilisateur, sur n’importe quelle base et venant de
n’importe quelle source, doit utiliser le mécanisme d’authentification
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;scram-sha-256&lt;/code&gt;.&lt;/p&gt;

&lt;h3 id=&quot;restriction-forte-des-accès&quot;&gt;Restriction forte des accès&lt;/h3&gt;

&lt;p&gt;L’ajout de règles se fait via l’opérateur et doit être écrite dans la
définition YAML du &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Cluster&lt;/code&gt;. Prenons le cas de figure où l’on souhaite
autoriser uniquement un rôle d’administration (&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;admin&lt;/code&gt;) à se connecter
à la base &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;postgres&lt;/code&gt; à distance. Toutes les autres connexions doivent être
rejetées (&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;reject&lt;/code&gt;). Cela donnerait quelque chose comme :&lt;/p&gt;

&lt;div class=&quot;language-yaml highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;na&quot;&gt;apiVersion&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;postgresql.cnpg.io/v1&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;kind&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;Cluster&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;metadata&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;postgresql-prod&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;spec&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;instances&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;1&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;storage&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;size&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;1Gi&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;postgresql&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;pg_hba&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;host postgres admin all scram-sha-256&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;host all all all reject&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Pour des raisons de sécurité, il est préférable de restreindre les connexions
provenant de sources bien identifiées. Ainsi le mot clé &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;all&lt;/code&gt; dans cette ligne&lt;/p&gt;

&lt;div class=&quot;language-yaml highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;host postgres admin all scram-sha-256&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;devrait être changé par &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;10.244.0.10/32&lt;/code&gt;, la seule adresse IP source autorisée.
Une restriction forte est donc appliquée… mais qu’en est-il si l’adresse IP
autorisée venait à changer une fois ? la modification ne serait pas trop lourde
à effectuer. Deux fois ? On prendra notre mal en patience et on le ferait. Mais
100 fois ? 1000 fois ? Cela deviendrait intenable. Ceci est d’autant plus vrai
que, dans un contexte Kubernetes, la volatilité des &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Pods&lt;/code&gt;, et donc de leur
adresse IP, est grande et même inhérente à sa conception. Il faut donc avoir un
outil qui permettrait de tenir à jour le fichier &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;pg_hba.conf&lt;/code&gt; de notre &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Cluster&lt;/code&gt;.&lt;/p&gt;

&lt;h3 id=&quot;résolution-dynamique-dadresse&quot;&gt;Résolution dynamique d’adresse&lt;/h3&gt;

&lt;p&gt;La version 1.29 de l’opérateur apporte cette solution en se reposant sur le
mécanisme de labels de Kubernetes. L’opérateur est capable de reconfigurer le
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;pg_hba.conf&lt;/code&gt; dynamiquement avec l’adresse IP des &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Pods&lt;/code&gt; qui ont un label
spécifique. Prenons l’exemple d’un &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Pod&lt;/code&gt; pgAdmin déployé avec une ressource
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Deployment&lt;/code&gt; pour laquelle le label &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;app=pgadmin&lt;/code&gt; est renseigné.&lt;/p&gt;

&lt;p&gt;Dans la partie &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;spec&lt;/code&gt; du &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Cluster&lt;/code&gt;, il est désormais possible de renseigner la
section &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;podSelectorRefs&lt;/code&gt; qui permet d’indiquer une référence aux &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Pods&lt;/code&gt;
(&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;podSelectorRefs&lt;/code&gt;) ayant un label spécifique (&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;selector.matchLabels&lt;/code&gt;).&lt;/p&gt;

&lt;div class=&quot;language-yaml highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;  &lt;span class=&quot;na&quot;&gt;podSelectorRefs&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;app-pgadmin&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;selector&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;matchLabels&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;app&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;pgadmin&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Aussi, dans la partie &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;pg_hba&lt;/code&gt;, le champ correspondant aux adresses IP peut être
remplacé par la syntaxe suivante &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;${podselector:app-pgadmin}&lt;/code&gt;.&lt;/p&gt;

&lt;div class=&quot;language-yaml highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;  &lt;span class=&quot;na&quot;&gt;postgresql&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;pg_hba&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;host postgres admin ${podselector:app-pgadmin} scram-sha-256&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;host all all all reject&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Désormais, dès lors qu’un &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Pod&lt;/code&gt; avec le label &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;app=pgadmin&lt;/code&gt; est créé,
CloudNativePG ajustera le fichier &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;pg_hba.conf&lt;/code&gt; et rechargera l’instance
PostgreSQL pour que la nouvelle adresse IP soit autorisée à se connecter.&lt;/p&gt;

&lt;p&gt;Le passage du paramètre &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;spec.replicas&lt;/code&gt; à 2 du &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Deployment&lt;/code&gt; pgAdmin est bien
“reporté” dans le fichier &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;pg_hba.conf&lt;/code&gt; : deux lignes sont présentes avec les
adresses IP des &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Pods&lt;/code&gt; pgAdmin.&lt;/p&gt;

&lt;div class=&quot;language-console highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;go&quot;&gt;psql (18.3 (Debian 18.3-1.pgdg13+1))
Type &quot;help&quot; for help.

&lt;/span&gt;&lt;span class=&quot;gp&quot;&gt;postgres=#&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;k&quot;&gt;select &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;type&lt;/span&gt;, database, user_name, address, netmask, auth_method from pg_hba_file_rules &lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;  type   |   database    |        user_name        |   address   |     netmask     |  auth_method  
---------+---------------+-------------------------+-------------+-----------------+---------------
 local   | {all}         | {cnpg_metrics_exporter} |             |                 | peer
 local   | {all}         | {all}                   |             |                 | peer
 hostssl | {postgres}    | {streaming_replica}     | all         |                 | cert
 hostssl | {replication} | {streaming_replica}     | all         |                 | cert
 hostssl | {all}         | {cnpg_pooler_pgbouncer} | all         |                 | cert
 host    | {postgres}    | {admin}                 | 10.244.0.11 | 255.255.255.255 | scram-sha-256
 host    | {postgres}    | {admin}                 | 10.244.0.12 | 255.255.255.255 | scram-sha-256
 host    | {all}         | {all}                   | all         |                 | reject
 host    | {all}         | {all}                   | all         |                 | scram-sha-256
(9 rows)
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;conclusion&quot;&gt;Conclusion&lt;/h3&gt;

&lt;p&gt;Maintenir un fichier &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;pg_hba.conf&lt;/code&gt; pour autoriser ou interdire les accès est
important. Dans un environnement virtualisé ou &lt;em&gt;baremetal&lt;/em&gt;, ce fichier n’est
généralement mis à jour que très ponctuellement. Dans des environnements Kubernetes
où la durée de vie des applications peut être très court, des mécanismes
d’automatisation sont nécessaires. C’est le cas de cette nouveauté de la version
1.29 de l’opérateur.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Des questions, des commentaires ? &lt;a href=&quot;mailto:pierrick.chovelon@dalibo.com?subject=[Commentaire-Blog] CloudNativePG&quot;&gt;Écrivez-nous !&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
</description>
				<pubDate>Thu, 28 May 2026 00:00:00 -0500</pubDate>
				<link>https://blog.dalibo.com/2026/05/28/cnpg-12.html</link>
				<guid isPermaLink="true">https://blog.dalibo.com/2026/05/28/cnpg-12.html</guid>
			</item>
		
			<item>
				<title>Sortie de PostgreSQL 18.4, 17.10, 16.14, 15.18 et 14.23</title>
				<description>&lt;p&gt;&lt;em&gt;Lyon, le 15 mai 2026&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Le PostgreSQL Global Development Group a publié le 14 mai &lt;strong&gt;&lt;a href=&quot;https://www.postgresql.org/about/news/postgresql-184-1710-1614-1518-and-1423-released-3297/&quot;&gt;une mise à
jour&lt;/a&gt;&lt;/strong&gt;
pour toutes les versions supportées de PostgreSQL, c’est-à-dire les versions
18.4, 17.10, 16.14, 15.18, 14.23. Cette mise à jour corrige 11 vulnérabilités de
sécurité et une soixantaine de bugs.&lt;/p&gt;

&lt;p&gt;Pour la liste complète, voir les &lt;a href=&quot;https://www.postgresql.org/docs/release/&quot;&gt;Notes de version&lt;/a&gt;.&lt;/p&gt;

&lt;!--MORE--&gt;

&lt;p&gt;&lt;img src=&quot;/img/202605_annonce_release.png&quot; alt=&quot;visuel annonce&quot; /&gt;&lt;/p&gt;

&lt;h3 id=&quot;annonce-de-fin-de-vie-de-postgresql-14&quot;&gt;Annonce de fin de vie de PostgreSQL 14&lt;/h3&gt;

&lt;p&gt;PostgreSQL 14 ne recevra plus de mises à jour après le 12 novembre 2026. Si vous
utilisez PostgreSQL 14 en production, nous vous conseillons de planifier la
migration vers une version plus récente et supportée. Voir la politique de
versionnement pour plus de détails.&lt;/p&gt;

&lt;h3 id=&quot;vulnérabilités-de-sécurité&quot;&gt;Vulnérabilités de sécurité&lt;/h3&gt;

&lt;h4 id=&quot;cve-2026-6472-la-commande-create-type-de-postgresql-ne-vérifie-pas-le-droit-create-de-sur-tous-les-schemas&quot;&gt;CVE-2026-6472: La commande CREATE TYPE de PostgreSQL ne vérifie pas le droit CREATE de sur tous les schemas&lt;/h4&gt;
&lt;p&gt;CVSS v3.1 Base Score: 5.4&lt;br /&gt;
Versions vulnérables : 14 - 18.&lt;br /&gt;
Une faille d’autorisation dans la commande CREATE TYPE de PostgreSQL permet au
créateur d’un objet de détourner d’autres requêtes qui utilisent &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;search_path&lt;/code&gt;
pour rechercher des types définis par l’utilisateur, y compris les types définis
par des extensions. En d’autres termes, la victime exécutera des fonctions SQL
arbitraires choisies par l’attaquant. Les versions antérieures à PostgreSQL
18.4, 17.10, 16.14, 15.18 et 14.23 sont concernées.&lt;/p&gt;

&lt;h4 id=&quot;cve-2026-6473-postgresql-sous-dimensionne-les-allocations-à-cause-dun-débordement-dentier&quot;&gt;CVE-2026-6473: PostgreSQL sous-dimensionne les allocations à cause d’un débordement d’entier&lt;/h4&gt;
&lt;p&gt;CVSS v3.1 Base Score: 8.8&lt;br /&gt;
Versions vulnérables : 14 - 18.&lt;br /&gt;
Le débordement d’entier, dans plusieurs fonctionnalitées de PostgreSQL, autorise
une application à forcer le serveur à sous-dimensionner une allocation et à
écrire hors limites. Cela entraîne une erreur de segmentation. Les versions
antérieures à PostgreSQL 18.4, 17.10, 16.14, 15.18 et 14.23 sont concernées.&lt;/p&gt;

&lt;h4 id=&quot;cve-2026-6474-la-fonction-postgresql-timeofday-peut-divulguer-des-parties-de-la-mémoire-du-serveur&quot;&gt;CVE-2026-6474: La fonction PostgreSQL timeofday() peut divulguer des parties de la mémoire du serveur&lt;/h4&gt;
&lt;p&gt;CVSS v3.1 Base Score: 4.3&lt;br /&gt;
Versions vulnérables : 14 - 18.&lt;br /&gt;
Une chaîne de caractères spécifique utilisée dans la fonction &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;timeofday()&lt;/code&gt; de
PostgreSQL permet à un attaquant d’extraire des portions de la mémoire du
serveur, via des fuseaux horaires spécialement conçus. Les versions antérieures
à PostgreSQL 18.4, 17.10, 16.14, 15.18 et 14.23 sont concernées.&lt;/p&gt;

&lt;h4 id=&quot;cve-2026-6475-les-commandes-pg_basebackup-et-pg_rewind-de-postgresql-peuvent-écraser-des-fichiers-sans-lien-avec-le-choix-du-superutilisateur&quot;&gt;CVE-2026-6475: Les commandes pg_basebackup et pg_rewind de PostgreSQL peuvent écraser des fichiers sans lien avec le choix du superutilisateur&lt;/h4&gt;
&lt;p&gt;CVSS v3.1 Base Score: 8.8&lt;br /&gt;
Versions vulnérables : 14 - 18.&lt;br /&gt;
Le suivi des liens symboliques dans le format brut de &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;pg_basebackup&lt;/code&gt; et dans
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;pg_rewind&lt;/code&gt; permet à un superutilisateur d’origine de réécrire des fichiers
locaux, par exemple &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/var/lib/postgres/.bashrc&lt;/code&gt;, qui détournent le compte du
système d’exploitation. Le fait est que le démarrage du serveur après ces
commandes implique une confiance implicite envers le superutilisateur d’origine,
en raison de fonctionnalités telles que shared_preload_libraries. Par
conséquent, l’attaque n’a de conséquences pratiques que si des actions sont
faites entre l’exécution de ces commandes et le démarrage du serveur, comme par
exemple le déplacement des fichiers vers une autre machine virtuelle ou la
création d’un instantané de la machine virtuelle. Les versions antérieures à
PostgreSQL 18.4, 17.10, 16.14, 15.18 et 14.23 sont concernées.&lt;/p&gt;

&lt;h4 id=&quot;cve-2026-6476-la-fonction-pg_createsubscriber-de-postgresql-permet-une-injection-sql-via-le-nom-de-labonnement&quot;&gt;CVE-2026-6476: La fonction pg_createsubscriber de PostgreSQL permet une injection SQL via le nom de l’abonnement&lt;/h4&gt;
&lt;p&gt;CVSS v3.1 Base Score: 7.2&lt;br /&gt;
Versions vulnérables : 17 - 18.&lt;br /&gt;
Une faille d’injection SQL dans la fonction &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;pg_createsubscriber&lt;/code&gt; de PostgreSQL
permet à un attaquant disposant des droits &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;pg_create_subscription&lt;/code&gt; d’exécuter du
code SQL arbitraire en tant que superutilisateur. L’attaque se produit lors de
la prochaine exécution de &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;pg_createsubscriber&lt;/code&gt;. Parmi les versions majeures 17 et
18, les versions mineures antérieures à PostgreSQL 18.4 et 17.10 sont
concernées. Les versions antérieures à PostgreSQL 17 ne sont pas concernées.&lt;/p&gt;

&lt;h4 id=&quot;cve-2026-6477-les-fonctions-lo_-de-la-bibliothèque-libpq-de-postgresql-permettent-au-superutilisateur-du-serveur-de-réécrire-la-mémoire-de-la-pile-du-client&quot;&gt;CVE-2026-6477: Les fonctions lo_* de la bibliothèque libpq de PostgreSQL permettent au superutilisateur du serveur de réécrire la mémoire de la pile du client&lt;/h4&gt;
&lt;p&gt;CVSS v3.1 Base Score: 8.8&lt;br /&gt;
Supported, Vulnerable Versions: 14 - 18.&lt;br /&gt;
L’utilisation de la fonction intrinsèquement dangereuse comme &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;PQfn(...,
result_is_int=0, ...)&lt;/code&gt; dans les fonctions &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;lo_export()&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;lo_read()&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;lo_lseek64()&lt;/code&gt;,
and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;lo_tell64()&lt;/code&gt; de la libpq autorise un superutilisateur de réécrire la pile
mémoire d’un client. C’est notamment le cas pour pg_dump  et psql qui utilisent
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;lo_read()&lt;/code&gt;. Les versions antérieures à PostgreSQL 18.4, 17.10, 16.14, 15.18 et
14.23 sont concernées.&lt;/p&gt;

&lt;h4 id=&quot;cve-2026-6478--postgresql-divulgue-des-mots-de-passe-hachés-en-md5&quot;&gt;CVE-2026-6478:  PostgreSQL divulgue des mots de passe hachés en MD5&lt;/h4&gt;
&lt;p&gt;CVSS v3.1 Base Score: 6.5&lt;br /&gt;
Versions vulnérables : 14 - 18.&lt;br /&gt;
Un canal de synchronisation caché dans la comparaison des mots de passe hachés
MD5 dans l’authentification PostgreSQL permet à un attaquant de récupérer
suffisament d’informations d’utilisateur pour s’authentifier. 
Cela n’affecte pas les mots de passe hachés en scram-sha-256, qui sont la valeur
par défaut dans toutes les versions supportées. Cependant, les bases de données
en version 13 existantes peuvent contenir des mots de passe hachés en MD5. Les
versions antérieures à PostgreSQL 18.4, 17.10, 16.14, 15.18 et 14.23 sont
concernées.&lt;/p&gt;

&lt;h4 id=&quot;cve-2026-6479-linitialisation-sslgss-de-postgresql-provoque-un-déni-de-service-via-une-récursion-non-contrôlée&quot;&gt;CVE-2026-6479: L’initialisation SSL/GSS de PostgreSQL provoque un déni de service, via une récursion non contrôlée.&lt;/h4&gt;
&lt;p&gt;CVSS v3.1 Base Score: 7.5&lt;br /&gt;
Versions vulnérables : 14 - 18.&lt;br /&gt;
Une récursion incontrôlée dans la négociation SSL et GSS de PostgreSQL permet à
un attaquant capable de se connecter à un socket AF_UNIX de PostgreSQL,
d’obtenir un déni de service. Si SSL et GSS sont désactivés, un attaquant peut
réaliser la même opération en accédant à un socket TCP de PostgreSQL. Les
versions antérieures à PostgreSQL 18.4, 17.10, 16.14, 15.18 et 14.23 sont
concernées.&lt;/p&gt;

&lt;h4 id=&quot;cve-2026-6575-la-fonction-pg_restore_attribute_stats-de-postgresql-accepte-des-valeurs-qui-entraînent-une-lecture-au-delà-de-la-fin-du-tableau-de-statistiques-lors-de-la-planification-de-la-requête&quot;&gt;CVE-2026-6575: La fonction pg_restore_attribute_stats de PostgreSQL accepte des valeurs qui entraînent une lecture au-delà de la fin du tableau de statistiques lors de la planification de la requête.&lt;/h4&gt;
&lt;p&gt;CVSS v3.1 Base Score: 4.3&lt;br /&gt;
Versions vulnérables : 18.&lt;br /&gt;
Une vulnérabilité de lecture du tampon dans la fonction
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;pg_restore_attribute_stats()&lt;/code&gt; de PostgreSQL accepte des valeurs de tableau de
longueur non adéquat, ce qui provoque une lecture au-delà de la fin d’un tableau
lors de la planification de la requête. Ceci permet à un responsable de table de
déduire des valeurs en mémoire au-delà de cette fin de tableau. Ce problème
affecte les versions majeures antérieures à PostgreSQL 18 et 18.4. Les versions
antérieures à PostgreSQL 18 ne sont pas concernées.&lt;/p&gt;

&lt;h4 id=&quot;cve-2026-6637-le-module-postgresql-refint-permet-le-dépassement-de-tampon-de-pile-et-linjection-sql&quot;&gt;CVE-2026-6637: Le module PostgreSQL refint permet le dépassement de tampon de pile et l’injection SQL.&lt;/h4&gt;
&lt;p&gt;CVSS v3.1 Base Score: 8.8&lt;br /&gt;
Versions vulnérables : 14 - 18.&lt;br /&gt;
Un dépassement de tampon de la pile dans le module &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;refint&lt;/code&gt; de PostgreSQL permet à
un utilisateur de base de données non privilégié d’exécuter du code arbitraire
en tant qu’utilisateur du système d’exploitation exécutant la base de données. 
Une autre attaque est possible si l’application déclare une colonne utilisateur
comme clé primaire en cascade. Une injection SQL est possible en mettant à jour
la valeur de la clé primaire. Le code SQL est exécuté en tant qu’utilisateur de
la base de données effectuant la mise à jour de la clé primaire. 
Les versions de PostgreSQL antérieures à 18.4, 17.10, 16.14, 15.18 et 14.23 sont concernées.&lt;/p&gt;

&lt;h4 id=&quot;cve-2026-6638-postgresql-refresh-publication-autorise-linjection-sql-via-le-nom-de-la-table&quot;&gt;CVE-2026-6638: PostgreSQL REFRESH PUBLICATION autorise l’injection SQL via le nom de la table.&lt;/h4&gt;
&lt;p&gt;CVSS v3.1 Base Score: 3.7&lt;br /&gt;
Versions vulnérables : 16 - 18.&lt;br /&gt;
Une injection SQL dans la réplication logique de PostgreSQL (&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ALTER SUBSCRIPTION
... REFRESH PUBLICATION&lt;/code&gt;) permet au créateur d’une table abonnée d’exécuter du
code SQL arbitraire avec les identifiants de publication de l’abonnement.
L’attaque prend effet lors du prochain appel à &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;REFRESH PUBLICATION&lt;/code&gt;. Les versions
majeures 16, 17 et 18, ainsi que les versions mineures antérieures à PostgreSQL
18.4, 17.10 et 16.14, sont concernées. Les versions antérieures à PostgreSQL 16
ne sont pas affectées.&lt;/p&gt;

&lt;h3 id=&quot;correctifs-et-améliorations&quot;&gt;Correctifs et améliorations&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;Correction d’un problème pouvant entraîner des résultats erronés lors de
l’utilisation d’une collation non déterministe sur un index unique.&lt;/li&gt;
  &lt;li&gt;Auparavant, une clé étrangère définie comme &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;DEFERRABLE INITIALLY DEFERRED&lt;/code&gt; se
comportait comme si elle était &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;NOT DEFERRABLE&lt;/code&gt; après avoir été mise en état
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;NOT ENFORCED&lt;/code&gt;, puis revenue à l’état &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ENFORCED&lt;/code&gt;. C’est maintenant corrigé. 
Si vous avez une clé étrangère présentant ce problème, vous pouvez le résoudre
après avoir installé cette mise à jour en la positionnant comme &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;NOT ENFORCED&lt;/code&gt;
puis &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ENFORCED&lt;/code&gt;.&lt;/li&gt;
  &lt;li&gt;Amélioration du planificateur lors du nettoyage de partitions.&lt;/li&gt;
  &lt;li&gt;Correctif sur les self-join pour mieux gérer les clauses qui ne portent que
sur des colonnes de type booléen.&lt;/li&gt;
  &lt;li&gt;Plusieurs corrections concernent les colonnes générées virtuellement,
notamment pour garantir que &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;INSERT ... ON CONFLICT&lt;/code&gt; fonctionne lorsque
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;EXCLUDED&lt;/code&gt; fait référence à une colonne générée virtuellement.&lt;/li&gt;
  &lt;li&gt;Un échec de sérialisation est signalé lorsque &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;MERGE&lt;/code&gt; rencontre une ligne mis
à jour simultanément avec les &lt;a href=&quot;https://www.postgresql.org/docs/current/transaction-iso.html&quot;&gt;modes d’isolation&lt;/a&gt; 
« repeatable » ou « serializable ».&lt;/li&gt;
  &lt;li&gt;Correction de &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;CREATE TABLE ... LIKE ... INCLUDING STATISTICS&lt;/code&gt; pour les cas où la
table source comportait une ou plusieurs colonnes supprimées.&lt;/li&gt;
  &lt;li&gt;Correction de &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;WITHOUT OVERLAPS&lt;/code&gt; pour autoriser l’utilisation de domaines.&lt;/li&gt;
  &lt;li&gt;Interdiction de faire d’un type composite un membre de lui-même via un &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;multirange&lt;/code&gt;.&lt;/li&gt;
  &lt;li&gt;Correction de résultats parfois incorrects lorsque &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;array_agg(anyarray)&lt;/code&gt; s’exécute en
parallèle.&lt;/li&gt;
  &lt;li&gt;Le bloat n’est plus conservé lors d’une restauration à partir d’une sauvegarde incrémentale.&lt;/li&gt;
  &lt;li&gt;La promotion d’une instance standby n’est plus bloquée par un processus de
synchronisation des slots de réplication logique.&lt;/li&gt;
  &lt;li&gt;La colonne &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;pid&lt;/code&gt; de la vue système &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;pg_aios&lt;/code&gt; affiche &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;NULL&lt;/code&gt; au lieu de &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;0&lt;/code&gt; lorsqu’une
entrée n’a pas de processus associé.&lt;/li&gt;
  &lt;li&gt;Correction des cas où &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;pg_stat_replication&lt;/code&gt; affiche un lag &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;NULL&lt;/code&gt; même lorsque
la réplication est active.&lt;/li&gt;
  &lt;li&gt;L’affichage des variables d’alias &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;JOIN&lt;/code&gt; utilisées dans &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;GROUP BY&lt;/code&gt; est maintenant correct.&lt;/li&gt;
  &lt;li&gt;Si le processus de démarrage échoue, les autres processus enfants sont
correctement arrêtés avant de stopper le postmaster.&lt;/li&gt;
  &lt;li&gt;Correction d’une race condition qui pouvait entraîner une instance stanby,
suivant une instance primaire dans une version mineure antérieure, à entrer
dans une boucle infinie de plantage et de redémarrage.&lt;/li&gt;
  &lt;li&gt;Empêche l’attente infine lors de l’arrêt d’un processus &lt;em&gt;walsender&lt;/em&gt; lorsque la
réplication logique publie activement des données.&lt;/li&gt;
  &lt;li&gt;Les modifications apportées aux &lt;em&gt;free space map&lt;/em&gt; des tables sont conservées
pendant un recovery. Cela pourrait améliorer les performances d’une instance
standby après sa promotion.&lt;/li&gt;
  &lt;li&gt;Correction de divers bugs dans le code de décompression des sauvegardes
utilisé dans &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;pg_basebackup&lt;/code&gt; et &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;pg_verifybackup&lt;/code&gt;.&lt;/li&gt;
  &lt;li&gt;Garantie que &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;pg_dumpall&lt;/code&gt; n’oublie pas de GRANT sur des rôles qui auraient été
donnés par un ROLE dont l’OID serait manquant.. Un message d’avertissement est
affiché sur la source du dump est PostgreSQL 16 ou une version ultérieure.&lt;/li&gt;
  &lt;li&gt;Correction de &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;pg_upgrade&lt;/code&gt; pour qu’il utilise la bonne version du protocole
lors de la connexion à d’anciens serveurs sources.&lt;/li&gt;
  &lt;li&gt;Correction de la sortie dans &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;pg_overexplain&lt;/code&gt; lors de l’utilisation de l’option &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;RANGE_TABLE&lt;/code&gt;.&lt;/li&gt;
  &lt;li&gt;Correction d’un bug dans &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;postgres_fdw&lt;/code&gt; causé par le nettoyage prématuré d’une
connexion ayant échoué.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;mettre-à-jour&quot;&gt;Mettre à jour&lt;/h3&gt;

&lt;p&gt;Toutes les mises à jour de PostgreSQL sont cumulatives.
Pour appliquer la mise à jour, comme pour les autres versions mineures,
les utilisateurs n’ont pas besoin de sauvegarder
et recharger leur base de données, ni d’utiliser &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;pg_upgrade&lt;/code&gt;. 
Vous pouvez simplement arrêter PostgreSQL et mettre à jour ses binaires.&lt;/p&gt;

&lt;p&gt;Les utilisateurs ayant sauté une version mineure ou plus peuvent avoir besoin de
réaliser d’autres opérations post-mise à jour. Voir les &lt;a href=&quot;https://www.postgresql.org/docs/release/&quot;&gt;Notes de version&lt;/a&gt; pour
les détails.&lt;/p&gt;

&lt;h3 id=&quot;liens&quot;&gt;Liens&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.postgresql.org/download/&quot;&gt;Téléchargements&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.postgresql.org/docs/release/&quot;&gt;Notes de version&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.postgresql.org/support/security/&quot;&gt;Sécurité&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.postgresql.org/support/versioning/&quot;&gt;Politique de versionnement&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.postgresql.org/account/submitbug/&quot;&gt;Soumettez un bug&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.postgresql.org/about/donate/&quot;&gt;Donnez&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</description>
				<pubDate>Fri, 15 May 2026 00:00:00 -0500</pubDate>
				<link>https://blog.dalibo.com/2026/05/15/postgresql_release_18.4.html</link>
				<guid isPermaLink="true">https://blog.dalibo.com/2026/05/15/postgresql_release_18.4.html</guid>
			</item>
		
			<item>
				<title>Manuels Dalibo : leur dernière mise à jour intègre PostgreSQL 18</title>
				<description>&lt;p&gt;&lt;em&gt;Saint-Étienne, le 15 mai 2026&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Voici les manuels Dalibo dans leur &lt;strong&gt;dernière version&lt;/strong&gt;, qui intègre les nouveautés de PostgreSQL 18. Toujours en libre accès sous format PDF, ePub, html et slides !&lt;/p&gt;

&lt;!--MORE--&gt;

&lt;h3 id=&quot;rappels-utiles&quot;&gt;Rappels utiles&lt;/h3&gt;

&lt;p&gt;Revue des cours, nouveaux TP et quiz, correctifs… La mise à jour des manuels est assurée nos DBA, par ailleurs formateurs et consultants.&lt;/p&gt;

&lt;p&gt;Découvrez le sommaire des formations Dalibo, le détail des différents modules et les liens vers les slides &lt;a href=&quot;https://dali.bo/menu&quot;&gt;ici&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Si vous notez des éléments qui demandent à être clarifiés, précisés, corrigés, vous pouvez nous écrire à &lt;a href=&quot;mailto:formation@dalibo.com&quot;&gt;formation@dalibo.com&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Les manuels sont publiés sous la licence &lt;a href=&quot;https://creativecommons.org/licenses/by-nc-sa/4.0/deed.fr&quot;&gt;CC BY-NC-SA&lt;/a&gt; qui autorise l’utilisation &lt;strong&gt;non commerciale&lt;/strong&gt;, le partage dans les mêmes conditions et la modification, à condition de créditer Dalibo.&lt;/p&gt;

&lt;div style=&quot;margin-bottom: 20px;&quot;&gt;&lt;/div&gt;

&lt;h3 id=&quot;les-manuels&quot;&gt;Les manuels&lt;/h3&gt;

&lt;p&gt;IMPORTANT : leur dernière version intègre les nouveautés de &lt;strong&gt;PostgreSQL 18&lt;/strong&gt;.&lt;/p&gt;

&lt;h4 id=&quot;administration&quot;&gt;Administration&lt;/h4&gt;

&lt;ul&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;a href=&quot;https://dali.bo/dba1&quot;&gt;DBA1&lt;/a&gt; - Administration PostgreSQL : &lt;a href=&quot;https://dali.bo/dba1_pdf&quot;&gt;PDF&lt;/a&gt;, &lt;a href=&quot;https://dali.bo/dba1_epub&quot;&gt;ePub&lt;/a&gt;, &lt;a href=&quot;https://dali.bo/dba1_html&quot;&gt;html&lt;/a&gt;&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;a href=&quot;https://dali.bo/dba2&quot;&gt;DBA2&lt;/a&gt; - Administration PostgreSQL Avancée : &lt;a href=&quot;https://dali.bo/dba2_pdf&quot;&gt;PDF&lt;/a&gt;, &lt;a href=&quot;https://dali.bo/dba2_epub&quot;&gt;ePub&lt;/a&gt;, &lt;a href=&quot;https://dali.bo/dba2_html&quot;&gt;html&lt;/a&gt;&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;a href=&quot;https://dali.bo/dba3&quot;&gt;DBA3&lt;/a&gt; - Sauvegarde et Réplication avec PostgreSQL : &lt;a href=&quot;https://dali.bo/dba3_pdf&quot;&gt;PDF&lt;/a&gt;, &lt;a href=&quot;https://dali.bo/dba3_epub&quot;&gt;ePub&lt;/a&gt;, &lt;a href=&quot;https://dali.bo/dba3_html&quot;&gt;html&lt;/a&gt;&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;a href=&quot;https://dali.bo/hapat&quot;&gt;HAPAT&lt;/a&gt; - Haute disponibilité avec PostgreSQL : &lt;a href=&quot;https://dali.bo/hapat_pdf&quot;&gt;PDF&lt;/a&gt;, &lt;a href=&quot;https://dali.bo/hapat_epub&quot;&gt;ePub&lt;/a&gt;, &lt;a href=&quot;https://dali.bo/hapat_html&quot;&gt;html&lt;/a&gt;&lt;/p&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;h4 id=&quot;développement&quot;&gt;Développement&lt;/h4&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://dali.bo/devpg&quot;&gt;DEVPG&lt;/a&gt; - Développer avec SQL : &lt;a href=&quot;https://dali.bo/devpg_pdf&quot;&gt;PDF&lt;/a&gt;, &lt;a href=&quot;https://dali.bo/devpg_epub&quot;&gt;ePub&lt;/a&gt;, &lt;a href=&quot;https://dali.bo/devpg_html&quot;&gt;html&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h4 id=&quot;performances&quot;&gt;Performances&lt;/h4&gt;

&lt;ul&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;a href=&quot;https://dali.bo/perf1&quot;&gt;PERF1&lt;/a&gt; - PostgreSQL Performances : &lt;a href=&quot;https://dali.bo/perf1_pdf&quot;&gt;PDF&lt;/a&gt;, &lt;a href=&quot;https://dali.bo/perf1_epub&quot;&gt;ePub&lt;/a&gt;, &lt;a href=&quot;https://dali.bo/perf1_html&quot;&gt;html&lt;/a&gt;&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;a href=&quot;https://dali.bo/perf2&quot;&gt;PERF2&lt;/a&gt; - Indexation et SQL Avancés : &lt;a href=&quot;https://dali.bo/perf2_pdf&quot;&gt;PDF&lt;/a&gt;, &lt;a href=&quot;https://dali.bo/perf2_epub&quot;&gt;ePub&lt;/a&gt;, &lt;a href=&quot;https://dali.bo/perf2_html&quot;&gt;html&lt;/a&gt;&lt;/p&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;h4 id=&quot;transition-vers-postgresql&quot;&gt;Transition vers PostgreSQL&lt;/h4&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://dali.bo/dbaadm&quot;&gt;DBAADM&lt;/a&gt; - Administration PostgreSQL pour DBA expérientés : &lt;a href=&quot;https://dali.bo/dbaadm_pdf&quot;&gt;PDF&lt;/a&gt;, &lt;a href=&quot;https://dali.bo/dbaadm_epub&quot;&gt;ePub&lt;/a&gt;, &lt;a href=&quot;https://dali.bo/dbaadm_html&quot;&gt;html&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;le-privilège-des-stagiaires&quot;&gt;Le privilège des stagiaires&lt;/h3&gt;

&lt;p&gt;Ces manuels ne sont pas commercialisés. Cependant, en vous inscrivant à une &lt;a href=&quot;https://dali.bo/manuels_formation&quot;&gt;formation Dalibo&lt;/a&gt;, vous recevrez un code pour commander gratuitement l’impression et la livraison à domicile de deux manuels de votre choix.&lt;/p&gt;

&lt;p&gt;Nous rappelons d’ailleurs que nos DBA donnent ces formations en intra ou inter-entreprises, en présentiel dans nos locaux parisiens, ou à distance.&lt;/p&gt;

&lt;p&gt;En attendant, bonne lecture à vous !&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;&lt;strong&gt;Des questions, des remarques ?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Écrivez-nous à &lt;a href=&quot;mailto:formation@dalibo.com&quot;&gt;formation@dalibo.com&lt;/a&gt;&lt;/strong&gt;.&lt;/p&gt;

</description>
				<pubDate>Fri, 15 May 2026 00:00:00 -0500</pubDate>
				<link>https://blog.dalibo.com/2026/05/15/maj_manuels.html</link>
				<guid isPermaLink="true">https://blog.dalibo.com/2026/05/15/maj_manuels.html</guid>
			</item>
		
	</channel>
</rss>
