SlideShare une entreprise Scribd logo
1  sur  36
Télécharger pour lire hors ligne
PostgreSQL 12 : Nouveautés
Sébastien Lardière
Loxodata
décembre 2019
slardiere PG12 – décembre 2019 1 / 36
Break It! Drop It!
Break It!
slardiere PG12 – décembre 2019 2 / 36
Break It! Drop It!
recovery.conf → /dev/null
slardiere PG12 – décembre 2019 3 / 36
Break It! Drop It!
standby et restauration
le fichier recovery.conf disparait
les paramètres sont dans postgresql.conf
les fichiers recovery.signal et standby.signal permettent de contrôler l’état
de l’instance
slardiere PG12 – décembre 2019 4 / 36
Break It! Drop It!
Restauration
une seule cible :
parmi : recovery_target_lsn, recovery_target_name,
recovery_target_time, et recovery_target_xid
avant, la dernière trouvée était utilisée
slardiere PG12 – décembre 2019 5 / 36
Break It! Drop It!
Les CTEs sont maintenant en ligne
l’exécution des CTEs était toujours séparée : CTE Scan on <ctename>
désormais en ligne dans le plan d’exécution
possibilité de forcer le fencing : with <ctename> as materialized ( ... )
attention aux régressions
slardiere PG12 – décembre 2019 6 / 36
Break It! Drop It!
L’option WITH OIDS de CREATE TABLE disparaît
déjà obsolète depuis longtemps
le type oid existe toujours
les attributs oid de pg_catalog sont maintenant visibles
aussi disparaissent :
les types abstime, reltime, et tinterval
l’extension timetravel
les attributs pg_constraint.consrc et pg_attrdef.adsrc
slardiere PG12 – décembre 2019 7 / 36
SQL
Write It!
slardiere PG12 – décembre 2019 8 / 36
SQL
Generated Columns
Exemple
CREATE TABLE people (
...,
height_cm numeric,
height_in numeric GENERATED ALWAYS AS (height_cm / 2.54) STORED
);
slardiere PG12 – décembre 2019 9 / 36
SQL
Collations non déterministes
Exemple
CREATE COLLATION case_insensitive
( provider = icu
, locale = ’und-u-ks-level2’
, deterministic = false);
CREATE COLLATION ignore_accents
( provider = icu
, locale = ’und-u-ks-level1-kc-true’
, deterministic = false);
slardiere PG12 – décembre 2019 10 / 36
SQL
SQL/JSON path
Exemple
{ "track": {
"segments": [
{ "location": [ 47.763, 13.4034 ],
"start time": "2018-10-14 10:05:14",
"HR": 73 }
, { "location": [ 47.706, 13.2635 ],
"start time": "2018-10-14 10:39:21",
"HR": 135 }
]
}
}
slardiere PG12 – décembre 2019 11 / 36
SQL
SQL/JSON path
Exemple
’$.track.segments[*] ? (@.HR > 130)."start time"’
’$.track ? (exists(@.segments[*] ? (@.HR > 130))).segments.size()’
slardiere PG12 – décembre 2019 12 / 36
SQL
REINDEX CONCURRENTLY
Exemple
REINDEX TABLE CONCURRENTLY my_broken_table;
slardiere PG12 – décembre 2019 13 / 36
SQL
COPY
Exemple
COPY country FROM ’/usr1/proj/bray/sql/country_data’
WHERE continent = 2 ;
slardiere PG12 – décembre 2019 14 / 36
SQL
Transactions
Exemple
BEGIN ISOLATION LEVEL SERIALIZABLE ;
...
COMMIT AND CHAIN ;
...
COMMIT ;
slardiere PG12 – décembre 2019 15 / 36
SQL
Et aussi :
optimisation de l’espace des Btree
performance du partitionnement accrue : INSERT/COPY, ATTACH, grand nombre de
partitions
réduction de l’empreinte des WALs pour les index GiST, GIN, et SP-GiST
index couvrants pour les GiST
CREATE STATISTICS : tableau des valeurs les plus communes sur plusieurs colonnes
SET SCHEMA ’value’ alias de SET search_path TO value (une seule valeur)
slardiere PG12 – décembre 2019 16 / 36
Clients
Connect It!
slardiere PG12 – décembre 2019 17 / 36
Clients
Authentification :
authentification GSSAPI chiffrée dans pg_hba.conf : hostgssenc et
hostnogssenc
vérification du rôle dans le certificat client : clientcert=verify-full
découverte des serveurs LDAP dans les enregistrements DNS SRV
ssl_min_protocol_version et ssl_max_protocol_version
slardiere PG12 – décembre 2019 18 / 36
Clients
Client psql :
Sortie CSV
pset format csv
psql --csv
slardiere PG12 – décembre 2019 19 / 36
Internals
Internals
slardiere PG12 – décembre 2019 20 / 36
Internals
Just In Time
Compilation JIT activée par défaut
mais pas présente par défaut
slardiere PG12 – décembre 2019 21 / 36
Internals
Sommes de contrôle
pg_checksums peut activer ou désactiver la fonctionnalité
l’instance doit être arrêtée
slardiere PG12 – décembre 2019 22 / 36
Internals
ALTER TABLE
amélioration des performances :
ALTER TABLE ... SET NOT NULL
ALTER TABLE ... SET DATA TYPE entre timestamp et timestamptz , si UTC
slardiere PG12 – décembre 2019 23 / 36
Internals
Réplication
fonction pg_promote(), en plus de pg_ctl promote
max_wal_senders n’est plus compté dans max_connections
slardiere PG12 – décembre 2019 24 / 36
Internals
VACUUM
paramètres vacuum_truncate et toast.vacuum_truncate pour ne plus
tronquer les pages de fin de segments
option INDEX_CLEANUP et vacuum_index_cleanup (tables) pour ne pas traiter les
index
option SKIP_LOCKED pour ne pas traiter les tables qu’on ne peut verrouiller tout de
suite
slardiere PG12 – décembre 2019 25 / 36
Internals
ACCESS METHOD
CREATE ACCESS METHOD pour de nouveaux types de tables
heap est toujours la seule méthode
à venir : zheap, zedstore
slardiere PG12 – décembre 2019 26 / 36
Internals
Et aussi :
parallélisation des transactions SERIALIZABLE
vue pg_stat_progress_create_index pour CREATE INDEX et REINDEX
vue pg_stat_progress_cluster pour CLUSTER et VACUUM FULL
pg_upgrade --clone (au lieu de --link)
slardiere PG12 – décembre 2019 27 / 36
Configuration
Configure It!
slardiere PG12 – décembre 2019 28 / 36
Configuration
Timeline
recovery_target_timeline = ’latest’
slardiere PG12 – décembre 2019 29 / 36
Configuration
LOG :
log_transaction_sample_rate : échantillon de requêtes
slardiere PG12 – décembre 2019 30 / 36
Configuration
WAL :
wal_recycle and wal_init_zero : contrôle le recyclage des fichiers de WALs
utile pour les systèmes de fichiers faisant du Copy On Write
slardiere PG12 – décembre 2019 31 / 36
Configuration
Digits
permet : SET work_mem = ’30.1GB’
les paramètres utilisant le temps peuvent être en microsecondes : us
slardiere PG12 – décembre 2019 32 / 36
Extensions
Extends It!
slardiere PG12 – décembre 2019 33 / 36
Extensions
postgres_fdw
Pousse : ORDER BY et LIMIT
slardiere PG12 – décembre 2019 34 / 36
Extensions
pg_stat_statements
Granularité de pg_stat_statements_reset() : DB, rôles, requêtes
slardiere PG12 – décembre 2019 35 / 36
Extensions
Merci!
Des Questions?
slardiere PG12 – décembre 2019 36 / 36

Contenu connexe

En vedette

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by HubspotMarius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 

En vedette (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

Nouveautés PostgreSQL 12