The Need For Speed. leads to PostgreSQL. Dimitri Fontaine dimitri@2ndquadrant.fr. 28 Mars 2013



Similar documents
Introduction au BIM. ESEB Seyssinet-Pariset Economie de la construction contact@eseb.fr

Introduction ToIP/Asterisk Quelques applications Trixbox/FOP Autres distributions Conclusion. Asterisk et la ToIP. Projet tuteuré

Sun Management Center Change Manager Release Notes

Audit de sécurité avec Backtrack 5

REVOCABILITY. Contact: Lars MEINHARDT, Telephone:(32-2) ,

Introduction Les failles les plus courantes Les injections SQL. Failles Web. Maxime Arthaud. net7. Jeudi 03 avril 2014.

Setting up a monitoring and remote control tool

System Requirements Orion

Langages Orientés Objet Java

Solaris 10 Documentation README

Level 2 French, 2014

TP1 : Correction. Rappels : Stream, Thread et Socket TCP

Memory Eye SSTIC Yoann Guillot. Sogeti / ESEC R&D yoann.guillot(at)sogeti.com

Post-Secondary Opportunities For Student-Athletes / Opportunités post-secondaire pour les étudiantathlètes

Sun StorEdge A5000 Installation Guide

Service Level Definitions and Interactions

Sun Cluster 2.2 7/00 Data Services Update: Apache Web Server

Second Year French MFL1 Scheme of Work Studio 2 Module 1 T es branché? 4 lessons per 2 week cycle (aim to finish by mid-november)

French 2A. Course Overview

FOR TEACHERS ONLY The University of the State of New York

ATP Co C pyr y ight 2013 B l B ue C o C at S y S s y tems I nc. All R i R ghts R e R serve v d. 1

EPREUVE D EXPRESSION ORALE. SAVOIR et SAVOIR-FAIRE

Optimizing Solaris Resources Through Load Balancing

Altiris Patch Management Solution for Windows 7.6 from Symantec Third-Party Legal Notices

BUSINESS PROCESS OPTIMIZATION. OPTIMIZATION DES PROCESSUS D ENTERPRISE Comment d aborder la qualité en améliorant le processus

Sun Management Center 3.5 Update 1b Release Notes

N1 Grid Service Provisioning System 5.0 User s Guide for the Linux Plug-In

Il est repris ci-dessous sans aucune complétude - quelques éléments de cet article, dont il est fait des citations (texte entre guillemets).

Note concernant votre accord de souscription au service «Trusted Certificate Service» (TCS)

site et appel d'offres

Veritas Storage Foundation 5.0 Software for SPARC

Reconstruction d un modèle géométrique à partir d un maillage 3D issu d un scanner surfacique

Percentage Ladder French Unit 1: Qu est-ce que tu aimes regarder? Year 8 Reading and Speaking

Technical Service Bulletin

SunFDDI 6.0 on the Sun Enterprise Server

Service Level Agreement in the Data Center

Sun Enterprise Optional Power Sequencer Installation Guide

General Certificate of Education Advanced Level Examination June 2012

Qu est-ce que le Cloud? Quels sont ses points forts? Pourquoi l'adopter? Hugues De Pra Data Center Lead Cisco Belgium & Luxemburg

HEALTH CARE DIRECTIVES ACT

Survey on Conference Services provided by the United Nations Office at Geneva

Altiris Patch Management Solution for Windows 7.5 SP1 from Symantec Third-Party Legal Notices

"Internationalization vs. Localization: The Translation of Videogame Advertising"

First-half 2012 Results. August 29 th, Jean-Paul AGON. Chairman and CEO

Assessments; Optional module 1 vert assessments. Own test on the perfect tense

Sun StorEdge RAID Manager Release Notes

Student e-book. With a French Accent. Grammar. French Basics. Easy grammatical explanations and practical, everyday language

Enterprise Risk Management & Board members. GUBERNA Alumni Event June 19 th 2014 Prepared by Gaëtan LEFEVRE

Upgrading the Solaris PC NetLink Software

Liste d'adresses URL

Disaster Recovery Requirements Analysis

I will explain to you in English why everything from now on will be in French

sept-2002 Computer architecture and software cells for broadband networks Va avec

Hours: The hours for the class are divided between practicum and in-class activities. The dates and hours are as follows:

ANIMATION OF CONTINUOUS COMPUTER SIMULATIONS C.M. Woodside and Richard Mallet Computer Center, Carleton University ABSTRACT

ROME INTERNATIONAL MIDDLE/HIGH SCHOOL SYNOPSIS

In this lesson, I will view an animation titled La météo au Canada. 1. Open Section Two, Day One of the Workbook and complete the Reflection.

CSS : petits compléments

In-Home Caregivers Teleconference with Canadian Bar Association September 17, 2015

Scrubbing Disks Using the Solaris Operating Environment Format Program

Financial Literacy Resource French As a Second Language: Core French Grade 9 Academic FSF 1D ARGENT EN ACTION! Connections to Financial Literacy

Inspection des engins de transport

CFT ICT review Questions/Answers

AD511 Active Iridium Antenna User Manual Mar 12 V4.0

Personnalisez votre intérieur avec les revêtements imprimés ALYOS design

Archived Content. Contenu archivé

AgroMarketDay. Research Application Summary pp: Abstract

June 2016 Language and cultural workshops In-between session workshops à la carte June weeks All levels

Régression logistique : introduction

ENERGY SERVICES& ESCOS & THE ROLE OFBELESCO LIEVEN VANSTRAELEN IN BELGIUM

written by Talk in French Learn French as a habit French Beginner Grammar in 30 days

MONTÉSINOS 2015 NOTICE OF RACE 1. RULES

Thursday, February 7, DOM via PHP

ACP-EU Cooperation Programme in Science and Technology (S&T II) / Programme de Coopération ACP-UE pour la Science et la Technologie

You can choose to install the plugin through Magento Connect or by directly using the archive files.

Sun StorEdge T3 Dual Storage Array - Part 1

Competitive Intelligence en quelques mots

Exploring the iplanet Directory Server NIS Extensions

BILL C-665 PROJET DE LOI C-665 C-665 C-665 HOUSE OF COMMONS OF CANADA CHAMBRE DES COMMUNES DU CANADA

Solaris Bandwidth Manager

Sun TM SNMP Management Agent Release Notes, Version 1.6

C. read for meaning from a variety of authentic and educational sources

SCREENING OF SUBSTANCE USE PROBLEMS

AP FRENCH LANGUAGE AND CULTURE EXAM 2015 SCORING GUIDELINES

Sun Management Center 3.6 Version 5 Add-On Software Release Notes

RÉPONSE DE ÉNERGIE LA LIÈVRE S.E.C. ET D ÉNERGIE BROOKFIELD MARKETING INC. À LA DEMANDE DE RENSEIGNEMENT N o 1 DE LA RÉGIE DE L ÉNERGIE («RÉGIE»)

The Premium Review. 7 December 2006

Rapid Recovery Techniques: Auditing Custom Software Configuration

Archived Content. Contenu archivé

Une campagne de sensibilisation est lancée (1) pour lutter (1) contre les conséquences de l'alcool au volant. Il faut absolument réussir (2).

Transcription:

The Need For Speed leads to PostgreSQL Dimitri Fontaine dimitri@2ndquadrant.fr 28 Mars 2013 Dimitri Fontaine dimitri@2ndquadrant.fr The Need For Speed 28 Mars 2013 1 / 23

Dimitri Fontaine 2ndQuadrant France PostgreSQL Major Contributor pgloader, prefix, skytools, debian,... CREATE EXTENSION CREATE EVENT TRIGGER Bi-Directional Réplication Partitionnement Dimitri Fontaine dimitri@2ndquadrant.fr The Need For Speed 28 Mars 2013 2 / 23

Performances Dimitri Fontaine dimitri@2ndquadrant.fr The Need For Speed 28 Mars 2013 3 / 23

Dimitri Fontaine dimitri@2ndquadrant.fr The Need For Speed 28 Mars 2013 4 / 23

Dimitri Fontaine dimitri@2ndquadrant.fr The Need For Speed 28 Mars 2013 5 / 23

Optimisation SQL Quelques expériences d optimisations Optimisation de requêtes Migration Oracle, de 1h30 à 5mins prefix, GiST indexing pgloader preprepare Dimitri Fontaine dimitri@2ndquadrant.fr The Need For Speed 28 Mars 2013 6 / 23

Extract Month From date, THE HORROR Certaines requêtes SQL sont assez faciles à optimiser. select f1, f2, f3, d from t where extract( month from t.d) = extract( month from now()) Dimitri Fontaine dimitri@2ndquadrant.fr The Need For Speed 28 Mars 2013 7 / 23

Extract Month From date, THE HORROR Ah, tiens, un index! select f1, f2, f3, d from t where t.d >= date_trunc( month, now()) and t.d < date_trunc( month, now()) + interval 1 month Dimitri Fontaine dimitri@2ndquadrant.fr The Need For Speed 28 Mars 2013 8 / 23

Performance Club http://fetter.org/optimization.html 1 The first rule of Optimization is, you do not talk about Optimization. 2 The second rule of Optimization is, you DO NOT talk about Optimization. 3 If your app is running faster than the underlying transport protocol, the optimization is over. 4 One factor at a time. 5 No marketroids, no marketroid schedules. 6 Testing will go on as long as it has to. 7 If this is your first night at Optimization Club, you have to write a test case. Dimitri Fontaine dimitri@2ndquadrant.fr The Need For Speed 28 Mars 2013 9 / 23

Performance Club http://fetter.org/optimization.html 1 The first rule of Optimization is, you do not talk about Optimization. 2 The second rule of Optimization is, you DO NOT talk about Optimization. 3 If your app is running faster than the underlying transport protocol, the optimization is over. 4 One factor at a time. 5 No marketroids, no marketroid schedules. 6 Testing will go on as long as it has to. 7 If this is your first night at Optimization Club, you have to write a test case. Dimitri Fontaine dimitri@2ndquadrant.fr The Need For Speed 28 Mars 2013 9 / 23

Dimitri Fontaine dimitri@2ndquadrant.fr The Need For Speed 28 Mars 2013 10 / 23

Premature optimization is the root of all evil Donald Knuth, Structured Programming with go to Statements Programmers waste enormous amounts of time thinking about, or worrying about, the speed of noncritical parts of their programs, and these attempts at efficiency actually have a strong negative impact when debugging and maintenance are considered. We should forget about small efficiencies, say about 97% of the time: premature optimization is the root of all evil. Yet we should not pass up our opportunities in that critical 3%. Dimitri Fontaine dimitri@2ndquadrant.fr The Need For Speed 28 Mars 2013 11 / 23

La performance : quand s y intéresser? Premature optimization is the root of all evil Jamais trop tôt Avant qu il ne soit trop tard Préparation d une phase de croissance Réduction des dépenses énergétique Réduction de la facture d hébergement Meilleur service aux utilisateurs Dimitri Fontaine dimitri@2ndquadrant.fr The Need For Speed 28 Mars 2013 12 / 23

Diminishing Returns Loi des rendements décroissants Plus tu pédales moins vite, moins plus vite tu avances Maîtriser l effort d optimisation Difficulté de savoir quand on est allé assez loin Prendre du recul sur ce que l on fait Dimitri Fontaine dimitri@2ndquadrant.fr The Need For Speed 28 Mars 2013 13 / 23

La performance dans quel but http://www.copyblogger.com/website-speed-matters/ A one second delay in page-load can cause 7% loss in customer conversions. If you make $1,000 a month from your site that s seventy bucks a month you are losing and $840 a year. Can you afford to just throw away $70 a month? $840 a year? Dimitri Fontaine dimitri@2ndquadrant.fr The Need For Speed 28 Mars 2013 14 / 23

La performance c est quoi? Améliorer les performances ne peut se faire qu après avoir profilé Loi d Amdahl profiling metrologie Dimitri Fontaine dimitri@2ndquadrant.fr The Need For Speed 28 Mars 2013 15 / 23

La performance c est quoi? Mesurer les performances EXPLAIN EXPLAIN (VERBOSE, BUFFERS, ANALYZE) \timing Dimitri Fontaine dimitri@2ndquadrant.fr The Need For Speed 28 Mars 2013 16 / 23

La performance c est quoi? Attention aux allers retours entre client et serveur Round-trip Bande passante (bandwidth) Dimitri Fontaine dimitri@2ndquadrant.fr The Need For Speed 28 Mars 2013 17 / 23

Comment améliorer les performances Premier réflexe : ne pas exécuter la requête! Traitements par lots (batch) Traitements hors lignes (asynchrone) PGQ LISTEN et NOTIFY Dimitri Fontaine dimitri@2ndquadrant.fr The Need For Speed 28 Mars 2013 18 / 23

Outils d anlyze des performances des requêtes 1/2 Analyzer les performances EXPLAIN (ANALYZE, VERBOSE, BUFFERS) INSERT, DELETE, UPDATE (ne pas oublier de ROLLBACK) Dimitri Fontaine dimitri@2ndquadrant.fr The Need For Speed 28 Mars 2013 19 / 23

Outils d anlyze des performances des requêtes 2/2 Analyzer les performances Un mot sur les Nested Loops http://explain.depesz.com/ SELECT * FROM pg locks; pg activity Dimitri Fontaine dimitri@2ndquadrant.fr The Need For Speed 28 Mars 2013 20 / 23

Dimitri Fontaine dimitri@2ndquadrant.fr The Need For Speed 28 Mars 2013 21 / 23

Optimisation Les approches essentielles Identifier les requêtes Réécrire les requêtes Traiter moins de données Revoir les Types de données Revoir l utilisation des indexes Utiliser des tableaux WITH et OFFSET Dimitri Fontaine dimitri@2ndquadrant.fr The Need For Speed 28 Mars 2013 22 / 23

Optimisation Les approches essentielles Identifier les requêtes Réécrire les requêtes Traiter moins de données Revoir les Types de données Revoir l utilisation des indexes Utiliser des tableaux WITH et OFFSET Dimitri Fontaine dimitri@2ndquadrant.fr The Need For Speed 28 Mars 2013 22 / 23

Optimisation Les approches essentielles Identifier les requêtes Réécrire les requêtes Traiter moins de données Revoir les Types de données Revoir l utilisation des indexes Utiliser des tableaux WITH et OFFSET Dimitri Fontaine dimitri@2ndquadrant.fr The Need For Speed 28 Mars 2013 22 / 23

Conclusion The Need For Speed. Dimitri Fontaine dimitri@2ndquadrant.fr The Need For Speed 28 Mars 2013 23 / 23