SlideShare uma empresa Scribd logo
1 de 36
Baixar para ler offline
2010 Hokkaido
              http://www.ospn.jp/osc2010-do/




PostgreSQL 9.0


     PostgreSQL            / NTT OSS



              2010.6.26


                                                         1
PostgreSQL 9.0




                 /




                     2
PostgreSQL 9.0
              9.0 5
                                                                                                                 9.0.0
                                                                    2      /                 3


Ingress
 Ingress         PostgreSQL
                 PostgreSQL                                       8.1
1977
                     6.0
                     6.0
                                          7.4
                                          7.4
                                                          ••
                                                          •2
                                                                                      8.3                 9.0 (2010/8    )
                                                           •2
       1986
               1996
                       2000                               ••
                                                                                 •HOT:
                                                                                 •HOT:                •
                                                                                                      •
                                 2003                                            •VACUUM
                                                                                 •VACUUM
                                         2004
                                                                                 •
                                                                                 •
                                                                                                      •
                                                                                                      •
POSTGRES
POSTGRES                                           2005
                                                                                                      •
                                                                                                      •    //
                                                                  2006
                      7.3
                      7.3                                                                             •
                                                                                                      •
                                                                               2007
                                                                                      2008
                                                                                                 2009
                                        8.0                                                                     2010
                            •Windows                                     8.2
                            •Windows
                            ••                                  •CPU
                                                                •CPU
                            ••                  (PITR)
                                                 (PITR)         •
                                                                •                                8.
                            ••                                  •GIN:
                                                                •GIN:                  Window
                                                                                       Window
                                                                                       •VACUUM
                                                                                       •VACUUM
                                                                                       • DBMS
                                                                                       • DBMS

                                                                                                                         3
PostgreSQL 9.0


      1.
      2.              (                                              )
      3.            VACUUM FULL

                                                     1           2            3



                                           /
      LISTEN/NOTIFY                    /
      Windows                 64-bit
  (                                            URL         )
           http://developer.postgresql.org/pgdocs/postgres/release-9-0.html
           http://lets.postgresql.jp/documents/technical/9.0/

                                                                                  4
1.
 9.0              2




                          •
     =
     =                    •



                      (       )

         VACUUM
                  /
     PostgreSQL
                                  5
vs.
        READ WRITE                READ WRITE




                        ( v8.4)

8.4
                                                  WAL
      archive_command    WAL      pg_standby
                                                        ( 1 )

        READ WRITE                READ WRITE




9.0                     (v9.0)
                                                  WAL
                                                        (       )
          wal sender     WAL       wal receiver



      9.0
      9.0
                                                                6
vs.
                         Slony-I                pgpool-II
           9.0             2.0                    2.3




          DB             (             )        DB
SQL                 PK       , DDL     ※

      ☆        10             10                     3
                                            (               )
                                                     ○
                                                     ○
                             ○


                ☆                    ※PK=   , DDL=              7
2.

                   (UNIQUE)
      “    ”   “    ”
               (EXCLUDE)
      “        ”          “   ”




     GPS

                                  8
CREATE TABLE placement (
                                     &&       “    ”
  object   text,
  location box, --
  EXCLUDE USING gist (location WITH &&)
);


CREATE TABLE reservation (
  room    text,
  during period, -- {        ,      }
  EXCLUDE USING gist (room WITH =, during WITH &&)
);
                                    gist

    text   gist               contrib/btree_gist
    period          (   9.1          )

                                                       9
3.          VACUUM FULL
 VACUUM FULL
     8.4      “    ”
             →
     9.0      “    ”
                       →

 VACUUM FULL
 VACUUM FULL                  UP
                              UP

                       VACUUM (        )
     FULL
                  FULL
                           +TRUNCATE

                                           10
PostgreSQL


  VACUUM
VACUUM     8.4                                    ,
 FULL      9.0                                    ,
 CLUSTER              +                           ,
  REINDEX                 -                       ,

      VACUUM

 VACUUM FULL (8.4)
            REINDEX
 VACUUM FULL (9.0)            CLUSTER   REINDEX
         REINDEX
                                                      11
+




    12
PostgreSQL 9.0
                 (HS)

                               2
                        (SR)
    WAL




    8.0

    8.3

    9.0
                                   13
(PG8.0)




        archive_command
rsync
                = cp, scp




                                14
(PG8.0)




   restore_command     rsync
           = cp, scp




                               15
(PG8.3)

DB                         DB




        restore_command
            = pg_standby




                           16
(PG9.0)

DB                                            DB

     primary_conninfo


                                              OK
             restore_command
                     = cp, scp
                                 pg_standby




                                               17
SQL (                )
master/standby                /
                 (standby   master    )


                                     18
(    OK)




SQL


            19
vs.
      9.0




            (    )


(               )
                                     9.1



cf. MySQL 5.5 : Semi-Synchronous Replication

                     ?                         ?
                                                   20
WAL
            WAL                ?
① pg_current_xlog_location()
                WAL                 /
② pg_last_xlog_receive_location()
③ pg_last_xlog_replay_location()



      :②   ①
        :③   ①
                         SQL
                         (32bit+32bit   )
                        WAL



                                            21
pg_dump
– max_standby_delay


–     /


– pg_start_backup()   / pg_control




                                     22
23
:
postgresql.conf
  wal_level → hot_standby, archive_mode → on



  archive_command
     WAL
  vacuum_defer_cleanup_age
                          VACUUM           ?
  max_wal_senders →
                      max_connections
  wal_sender_delay




                                               24
:
postgresql.conf
   hot_standby → on
                           ?
   max_standby_delay = 30s


recovery.conf                  recovery.conf
   standby_mode = ‘on’
                                    ?
      off                       (WAL           )
   primary_conninfo

   restore_command
      WAL
   trigger_file

                  pg_ctl stop → start

                                                   25
: wal_level (          )
WAL
      minimal (         )


                    WAL
           COPY TO, CREATE INDEX, CLUSTER, VACUUM FULL
                  8.4       archive_mode = off

      archive


                  8.4       archive_mode = on
                             archive_mode
      hot_standby
        archive
WAL

                                                         26
max_standby_delay (                               )
                 ?




pg_dump




                                           or

canceling statement due to conflict with recovery
terminating connection due to conflict with recovery

                                                           27
vacuum_defer_cleanup_age (       )
               ?
max_standby_delay
VACUUM
  PostgreSQL        = UPDATE, DELETE
HOT
  VACUUM autovacuum            HOT




                                           28
max_connections :
max_prepared_xacts : XA
max_locks_per_xact :




max_connections =
                    + max_wal_senders


wal_level, archive_mode, max_wal_senders
                                  (pg_ctl reload)
                                                29
30
wal_level = hot_standby
                                        archive_mode = on
EDIT $PGDATA1/postgresql.conf           archive_command = 'cp %p /arclog/%f'
                                        max_wal_senders = 1
EDIT $PGDATA1/pg_hba.conf
pg_ctl start -D $PGDATA1
SELECT pg_start_backup(‘label’)       host replication postgres ::1/128 trust
rsync      (            )
SELECT pg_stop_backup()           rsync -av –delete
                                  --exclude=pg_xlog --exclude=postmaster.pid
                                  $PGDATA1/* $BACKUP/pgdata


rsync      (              )
                                       hot_standby = on
   chmod -R 0700
                                       ※
   mkdir $PGDATA2/pg_xlog
EDIT $PGDATA2/postgresql.conf
EDIT $PGDATA2/recovery.conf
                                       restore_command = 'cp /arclog/%f %p'
pg_ctl start -D $PGDATA2
                                       standby_mode = 'on'
                                       primary_conninfo = 'host=localhost'

                                                                            31
/
                              ①


         pg_ctl start                   pg_ctl start
standby_mode = ‘off’                    standby_mode = ‘on’
                          pg_ctl stop


pg_ctl stop             trigger_file


                                             (            )
       ②

                                                         32
PostgreSQL “9.0”
“               ”

                        “Let’s Postgres”
    http://lets.postgresql.jp/documents/technical/9.0/1



  SQL
        =




                                                          33
34
PostgreSQL            → 9.1
              9.1



   SQL/MED

                                             SQL-DB

                    SQL/MED      PostgreSQL



                              SQL/MED         DB


             UP                         UP


                                                      35
PostgreSQL 9.0




                 36

Mais conteúdo relacionado

Semelhante a PostgreSQL 9.0 Update ~ホット・スタンバイがやってきた!~

hbstudy@bpstudy#50 配布用
hbstudy@bpstudy#50 配布用hbstudy@bpstudy#50 配布用
hbstudy@bpstudy#50 配布用Toshiaki Baba
 
web_2.0_the_end_again
web_2.0_the_end_againweb_2.0_the_end_again
web_2.0_the_end_againgzioni
 
Polaris Company Presentation
Polaris Company PresentationPolaris Company Presentation
Polaris Company Presentationmoshe_m
 
Polaris company Presentation
Polaris company  PresentationPolaris company  Presentation
Polaris company Presentationmoshe_m
 
Ordina Planning & Scheduling Day - APS - quintiq 5 0 and beyond
Ordina Planning & Scheduling Day - APS - quintiq 5 0 and beyondOrdina Planning & Scheduling Day - APS - quintiq 5 0 and beyond
Ordina Planning & Scheduling Day - APS - quintiq 5 0 and beyondOrdina
 
유저스토리랩 회사소개서
유저스토리랩 회사소개서유저스토리랩 회사소개서
유저스토리랩 회사소개서userstorylab
 
とべとべ電設部勉強会20100717 DB meets Jiemamy
とべとべ電設部勉強会20100717  DB meets Jiemamyとべとべ電設部勉強会20100717  DB meets Jiemamy
とべとべ電設部勉強会20100717 DB meets Jiemamy都元ダイスケ Miyamoto
 
Word Camp Fukuoka 2010
Word Camp Fukuoka 2010Word Camp Fukuoka 2010
Word Camp Fukuoka 2010Junji Manno
 
2012.10.20 OSC 2012 Hiroshima
2012.10.20 OSC 2012 Hiroshima2012.10.20 OSC 2012 Hiroshima
2012.10.20 OSC 2012 HiroshimaRyusuke Kajiyama
 
Web技術の現状と将来 (Open Source Conference 2011 Tokyo Spring)
Web技術の現状と将来 (Open Source Conference 2011 Tokyo Spring)Web技術の現状と将来 (Open Source Conference 2011 Tokyo Spring)
Web技術の現状と将来 (Open Source Conference 2011 Tokyo Spring)Rikkyo University
 

Semelhante a PostgreSQL 9.0 Update ~ホット・スタンバイがやってきた!~ (11)

hbstudy@bpstudy#50 配布用
hbstudy@bpstudy#50 配布用hbstudy@bpstudy#50 配布用
hbstudy@bpstudy#50 配布用
 
web_2.0_the_end_again
web_2.0_the_end_againweb_2.0_the_end_again
web_2.0_the_end_again
 
Polaris Company Presentation
Polaris Company PresentationPolaris Company Presentation
Polaris Company Presentation
 
Polaris company Presentation
Polaris company  PresentationPolaris company  Presentation
Polaris company Presentation
 
Sample Roadmaps
Sample RoadmapsSample Roadmaps
Sample Roadmaps
 
Ordina Planning & Scheduling Day - APS - quintiq 5 0 and beyond
Ordina Planning & Scheduling Day - APS - quintiq 5 0 and beyondOrdina Planning & Scheduling Day - APS - quintiq 5 0 and beyond
Ordina Planning & Scheduling Day - APS - quintiq 5 0 and beyond
 
유저스토리랩 회사소개서
유저스토리랩 회사소개서유저스토리랩 회사소개서
유저스토리랩 회사소개서
 
とべとべ電設部勉強会20100717 DB meets Jiemamy
とべとべ電設部勉強会20100717  DB meets Jiemamyとべとべ電設部勉強会20100717  DB meets Jiemamy
とべとべ電設部勉強会20100717 DB meets Jiemamy
 
Word Camp Fukuoka 2010
Word Camp Fukuoka 2010Word Camp Fukuoka 2010
Word Camp Fukuoka 2010
 
2012.10.20 OSC 2012 Hiroshima
2012.10.20 OSC 2012 Hiroshima2012.10.20 OSC 2012 Hiroshima
2012.10.20 OSC 2012 Hiroshima
 
Web技術の現状と将来 (Open Source Conference 2011 Tokyo Spring)
Web技術の現状と将来 (Open Source Conference 2011 Tokyo Spring)Web技術の現状と将来 (Open Source Conference 2011 Tokyo Spring)
Web技術の現状と将来 (Open Source Conference 2011 Tokyo Spring)
 

Mais de Takahiro Itagaki

PostgreSQL 9.0 in OSC@Tokyo,Okinawa
PostgreSQL 9.0 in OSC@Tokyo,OkinawaPostgreSQL 9.0 in OSC@Tokyo,Okinawa
PostgreSQL 9.0 in OSC@Tokyo,OkinawaTakahiro Itagaki
 
問合せ最適化インサイド
問合せ最適化インサイド問合せ最適化インサイド
問合せ最適化インサイドTakahiro Itagaki
 
Wish list from PostgreSQL - Linux Kernel Summit 2009
Wish list from PostgreSQL - Linux Kernel Summit 2009Wish list from PostgreSQL - Linux Kernel Summit 2009
Wish list from PostgreSQL - Linux Kernel Summit 2009Takahiro Itagaki
 
コミュニティ開発に参加しよう!
コミュニティ開発に参加しよう!コミュニティ開発に参加しよう!
コミュニティ開発に参加しよう!Takahiro Itagaki
 

Mais de Takahiro Itagaki (6)

textsearch groonga v0.1
textsearch groonga v0.1textsearch groonga v0.1
textsearch groonga v0.1
 
PostgreSQL 9.0 in OSC@Tokyo,Okinawa
PostgreSQL 9.0 in OSC@Tokyo,OkinawaPostgreSQL 9.0 in OSC@Tokyo,Okinawa
PostgreSQL 9.0 in OSC@Tokyo,Okinawa
 
問合せ最適化インサイド
問合せ最適化インサイド問合せ最適化インサイド
問合せ最適化インサイド
 
Wish list from PostgreSQL - Linux Kernel Summit 2009
Wish list from PostgreSQL - Linux Kernel Summit 2009Wish list from PostgreSQL - Linux Kernel Summit 2009
Wish list from PostgreSQL - Linux Kernel Summit 2009
 
コミュニティ開発に参加しよう!
コミュニティ開発に参加しよう!コミュニティ開発に参加しよう!
コミュニティ開発に参加しよう!
 
PostgreSQL 8.3 Update
PostgreSQL 8.3 UpdatePostgreSQL 8.3 Update
PostgreSQL 8.3 Update
 

Último

Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 

Último (20)

Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 

PostgreSQL 9.0 Update ~ホット・スタンバイがやってきた!~

  • 1. 2010 Hokkaido http://www.ospn.jp/osc2010-do/ PostgreSQL 9.0 PostgreSQL / NTT OSS 2010.6.26 1
  • 3. PostgreSQL 9.0 9.0 5 9.0.0 2 / 3 Ingress Ingress PostgreSQL PostgreSQL 8.1 1977 6.0 6.0 7.4 7.4 •• •2 8.3 9.0 (2010/8 ) •2 1986 1996 2000 •• •HOT: •HOT: • • 2003 •VACUUM •VACUUM 2004 • • • • POSTGRES POSTGRES 2005 • • // 2006 7.3 7.3 • • 2007 2008 2009 8.0 2010 •Windows 8.2 •Windows •• •CPU •CPU •• (PITR) (PITR) • • 8. •• •GIN: •GIN: Window Window •VACUUM •VACUUM • DBMS • DBMS 3
  • 4. PostgreSQL 9.0 1. 2. ( ) 3. VACUUM FULL 1 2 3 / LISTEN/NOTIFY / Windows 64-bit ( URL ) http://developer.postgresql.org/pgdocs/postgres/release-9-0.html http://lets.postgresql.jp/documents/technical/9.0/ 4
  • 5. 1. 9.0 2 • = = • ( ) VACUUM / PostgreSQL 5
  • 6. vs. READ WRITE READ WRITE ( v8.4) 8.4 WAL archive_command WAL pg_standby ( 1 ) READ WRITE READ WRITE 9.0 (v9.0) WAL ( ) wal sender WAL wal receiver 9.0 9.0 6
  • 7. vs. Slony-I pgpool-II 9.0 2.0 2.3 DB ( ) DB SQL PK , DDL ※ ☆ 10 10 3 ( ) ○ ○ ○ ☆ ※PK= , DDL= 7
  • 8. 2. (UNIQUE) “ ” “ ” (EXCLUDE) “ ” “ ” GPS 8
  • 9. CREATE TABLE placement ( && “ ” object text, location box, -- EXCLUDE USING gist (location WITH &&) ); CREATE TABLE reservation ( room text, during period, -- { , } EXCLUDE USING gist (room WITH =, during WITH &&) ); gist text gist contrib/btree_gist period ( 9.1 ) 9
  • 10. 3. VACUUM FULL VACUUM FULL 8.4 “ ” → 9.0 “ ” → VACUUM FULL VACUUM FULL UP UP VACUUM ( ) FULL FULL +TRUNCATE 10
  • 11. PostgreSQL VACUUM VACUUM 8.4 , FULL 9.0 , CLUSTER + , REINDEX - , VACUUM VACUUM FULL (8.4) REINDEX VACUUM FULL (9.0) CLUSTER REINDEX REINDEX 11
  • 12. + 12
  • 13. PostgreSQL 9.0 (HS) 2 (SR) WAL 8.0 8.3 9.0 13
  • 14. (PG8.0) archive_command rsync = cp, scp 14
  • 15. (PG8.0) restore_command rsync = cp, scp 15
  • 16. (PG8.3) DB DB restore_command = pg_standby 16
  • 17. (PG9.0) DB DB primary_conninfo OK restore_command = cp, scp pg_standby 17
  • 18. SQL ( ) master/standby / (standby master ) 18
  • 19. ( OK) SQL 19
  • 20. vs. 9.0 ( ) ( ) 9.1 cf. MySQL 5.5 : Semi-Synchronous Replication ? ? 20
  • 21. WAL WAL ? ① pg_current_xlog_location() WAL / ② pg_last_xlog_receive_location() ③ pg_last_xlog_replay_location() :② ① :③ ① SQL (32bit+32bit ) WAL 21
  • 22. pg_dump – max_standby_delay – / – pg_start_backup() / pg_control 22
  • 23. 23
  • 24. : postgresql.conf wal_level → hot_standby, archive_mode → on archive_command WAL vacuum_defer_cleanup_age VACUUM ? max_wal_senders → max_connections wal_sender_delay 24
  • 25. : postgresql.conf hot_standby → on ? max_standby_delay = 30s recovery.conf recovery.conf standby_mode = ‘on’ ? off (WAL ) primary_conninfo restore_command WAL trigger_file pg_ctl stop → start 25
  • 26. : wal_level ( ) WAL minimal ( ) WAL COPY TO, CREATE INDEX, CLUSTER, VACUUM FULL 8.4 archive_mode = off archive 8.4 archive_mode = on archive_mode hot_standby archive WAL 26
  • 27. max_standby_delay ( ) ? pg_dump or canceling statement due to conflict with recovery terminating connection due to conflict with recovery 27
  • 28. vacuum_defer_cleanup_age ( ) ? max_standby_delay VACUUM PostgreSQL = UPDATE, DELETE HOT VACUUM autovacuum HOT 28
  • 29. max_connections : max_prepared_xacts : XA max_locks_per_xact : max_connections = + max_wal_senders wal_level, archive_mode, max_wal_senders (pg_ctl reload) 29
  • 30. 30
  • 31. wal_level = hot_standby archive_mode = on EDIT $PGDATA1/postgresql.conf archive_command = 'cp %p /arclog/%f' max_wal_senders = 1 EDIT $PGDATA1/pg_hba.conf pg_ctl start -D $PGDATA1 SELECT pg_start_backup(‘label’) host replication postgres ::1/128 trust rsync ( ) SELECT pg_stop_backup() rsync -av –delete --exclude=pg_xlog --exclude=postmaster.pid $PGDATA1/* $BACKUP/pgdata rsync ( ) hot_standby = on chmod -R 0700 ※ mkdir $PGDATA2/pg_xlog EDIT $PGDATA2/postgresql.conf EDIT $PGDATA2/recovery.conf restore_command = 'cp /arclog/%f %p' pg_ctl start -D $PGDATA2 standby_mode = 'on' primary_conninfo = 'host=localhost' 31
  • 32. / ① pg_ctl start pg_ctl start standby_mode = ‘off’ standby_mode = ‘on’ pg_ctl stop pg_ctl stop trigger_file ( ) ② 32
  • 33. PostgreSQL “9.0” “ ” “Let’s Postgres” http://lets.postgresql.jp/documents/technical/9.0/1 SQL = 33
  • 34. 34
  • 35. PostgreSQL → 9.1 9.1 SQL/MED SQL-DB SQL/MED PostgreSQL SQL/MED DB UP UP 35