Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

PostgreSQL : Architettura di storage

1,817 views

Published on

Slides www.pgtraining.com su PostgreSQL: architettura di storage

Published in: Education
  • DOWNLOAD THE BOOK INTO AVAILABLE FORMAT (New Update) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://urlzs.com/UABbn } ......................................................................................................................... Download Full EPUB Ebook here { https://urlzs.com/UABbn } ......................................................................................................................... Download Full doc Ebook here { https://urlzs.com/UABbn } ......................................................................................................................... Download PDF EBOOK here { https://urlzs.com/UABbn } ......................................................................................................................... Download EPUB Ebook here { https://urlzs.com/UABbn } ......................................................................................................................... Download doc Ebook here { https://urlzs.com/UABbn } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book THE can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer THE is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBOOK .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, CookBOOK, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, EBOOK, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story THE Helped Ignite a Movement,-- Atomic Habits: An Easy & Proven Way to Build Good Habits & Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money THE the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths THE Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD THE BOOK INTO AVAILABLE FORMAT (New Update) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://urlzs.com/UABbn } ......................................................................................................................... Download Full EPUB Ebook here { https://urlzs.com/UABbn } ......................................................................................................................... Download Full doc Ebook here { https://urlzs.com/UABbn } ......................................................................................................................... Download PDF EBOOK here { https://urlzs.com/UABbn } ......................................................................................................................... Download EPUB Ebook here { https://urlzs.com/UABbn } ......................................................................................................................... Download doc Ebook here { https://urlzs.com/UABbn } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book THE can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer THE is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBOOK .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, CookBOOK, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, EBOOK, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story THE Helped Ignite a Movement,-- Atomic Habits: An Easy & Proven Way to Build Good Habits & Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money THE the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths THE Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD THE BOOK INTO AVAILABLE FORMAT (New Update) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download Full EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download Full doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book THE can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer THE is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBOOK .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, CookBOOK, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, EBOOK, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story THE Helped Ignite a Movement,-- Atomic Habits: An Easy & Proven Way to Build Good Habits & Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money THE the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths THE Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD THE BOOK INTO AVAILABLE FORMAT (New Update) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download Full EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download Full doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book THE can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer THE is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBOOK .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, CookBOOK, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, EBOOK, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story THE Helped Ignite a Movement,-- Atomic Habits: An Easy & Proven Way to Build Good Habits & Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money THE the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths THE Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD THIS BOOKS INTO AVAILABLE FORMAT (2019 Update) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download Full EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download Full doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book THIS can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer THIS is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBooks .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story THIS Helped Ignite a Movement,-- Atomic Habits: An Easy & Proven Way to Build Good Habits & Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money THIS the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths THIS Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Be the first to like this

PostgreSQL : Architettura di storage

  1. 1. Architettura di storage Architettura di storage 27/11/08 /home/scotty/enrico/corso­web/finale/Architettura/arch1.odp page 1
  2. 2. Architettura di storage Cluster Databases Tabelle Indici Blocchi 27/11/08 /home/scotty/enrico/corso­web/finale/Architettura/arch1.odp page 2
  3. 3. Cluster Un database cluster è un insieme di basi di dati che  sono gestiti da una singola istanza del processo  server Creare un cluster database consiste in: Creare le directory in cui il database depositerà i dati Creare le tabelle comuni di catalogo Creare i template dei db Un processo postmaster per ogni cluster  Un cluster può essere interrogato attraverso una  sola directory data che può avere più tablespaces 27/11/08 /home/scotty/enrico/corso­web/finale/Architettura/arch1.odp page 3
  4. 4. Cluster Layout ­ overview Tutte le informazioni riguardante il cluster sono  nella directory data Global → system tables e control files Base → database tables e temp tables  pg_tblspc → links tablespace control/pg_contro → checkpoint master file pg_xlog → transactiona recovery log pg_clog, pg_subtrans → commit status pg_multixact → row locking pg_twophase → transazioni nello stato prepared  27/11/08 /home/scotty/enrico/corso­web/finale/Architettura/arch1.odp page 4
  5. 5. Cluster Layout ­ overview Conf postgresql.conf → file di configurazione Logs Serverlog → log Files di stato postmaster.pid PG_VERSION  27/11/08 /home/scotty/enrico/corso­web/finale/Architettura/arch1.odp page 5
  6. 6. Struttura delle directory Postgresql8.x Bin Data → dove vengono memorizzati i dati Doc Include Lib Man Share 27/11/08 /home/scotty/enrico/corso­web/finale/Architettura/arch1.odp page 6
  7. 7. Organizzazione dei dati Ogni database viene memorizzato in una directory Con uno o più files per ogni relazione Ogni file se > 1 Gb viene splittato Ogni relazione è memorizzata in un solo tablespace Si possono gestire link ad altre directory nel filesystem Per defaults gli indici vengono memorizzati nello stesso  tablespace 27/11/08 /home/scotty/enrico/corso­web/finale/Architettura/arch1.odp page 7
  8. 8. OID ­ database OID: Object identifier : è l'identificatore di un  oggetto (database, tabella...) Es : testdb=# SELECT datname, oid from pg_database   where datname='testdb';; datname  |  oid ­­­­­­­­­­­­­+­­­­­­­ testdb      | 16384 Al database testdb è associato l'oid 16384  27/11/08 /home/scotty/enrico/corso­web/finale/Architettura/arch1.odp page 8
  9. 9. OID ­ database Andiamo a vedere ora all'interno della cartella data/ base ls ­l | grep 16384 drwx­­­­­­ 2 postgres postgres 4096 2008­09­10 09:58 16384 Troviamo una directory dal nome 16384 OID DATABASE DIRECTORY 27/11/08 /home/scotty/enrico/corso­web/finale/Architettura/arch1.odp page 9
  10. 10. OID ­ Tables testdb=# create table testtb ( id serial not null  primary key, nome char(20));  NOTICE:  CREATE TABLE will create implicit sequence  "testtb_id_seq" for serial column "testtb.id" NOTICE:  CREATE TABLE / PRIMARY KEY will create  implicit index "testtb_pkey" for table "testtb" CREATE TABLE 27/11/08 /home/scotty/enrico/corso­web/finale/Architettura/arch1.odp page 10
  11. 11. OID ­ Tables testdb=# SELECT relname,oid from pg_class where  relname='testtb';  relname |  oid   ­­­­­­­­­+­­­­­­­  testtb  | 16387 (1 row) 27/11/08 /home/scotty/enrico/corso­web/finale/Architettura/arch1.odp page 11
  12. 12. OID ­ Tables data/base/16384# ls ­l | grep 16387 ­rw­­­­­­­ 1 postgres postgres      0 2008­09­10 11:05 16387 Una tabella diventa un file il cui nome  è l'object identifier 27/11/08 /home/scotty/enrico/corso­web/finale/Architettura/arch1.odp page 12
  13. 13. OID ­ Tables Le tabelle e gli indici vengono memorizzati in files  separati Il nome del file è uguale all'oid dell'oggetto Le tabelle o gli indici (Relazioni) che sono più grandi  di 1 Gb vengono divisi in segmenti di dimensione  inferiore al Gb Il primo segmento di chiama con il nome del file  uguale all'oid agli altri si aggiunge 1,2 etc.. 27/11/08 /home/scotty/enrico/corso­web/finale/Architettura/arch1.odp page 13
  14. 14. Layout di pagina Pagine di 8k → vengono caricate nello shared buffer  Page header (20 bytes):  Informazioni generali riguardo la pagina Puntatori alla spazio libero Puntatori alle tuple Spazio libero non allocato Row/Index Entry : tupla corrente Informazioni di sistema: metodo di accesso indice,  27/11/08 /home/scotty/enrico/corso­web/finale/Architettura/arch1.odp page 14
  15. 15. Layout di pagina Page header Item Item Item 8K Tuple Tuple Tuple Special 27/11/08 /home/scotty/enrico/corso­web/finale/Architettura/arch1.odp page 15
  16. 16. Layout di pagina testdb=# d               List of relations  Schema |     Name      |   Type   |  Owner    ­­­­­­­­+­­­­­­­­­­­­­­­+­­­­­­­­­­+­­­­­­­­­­  public | testtb        | table    | postgres  public | testtb_id_seq | sequence | postgres (2 rows) testdb=# INSERT INTO testtb (nome) values ('Enrico'); INSERT 0 1 testdb=# SELECT * from testtb;  id |         nome        ­­­­+­­­­­­­­­­­­­­­­­­­­­­   1 | Enrico               27/11/08 /home/scotty/enrico/corso­web/finale/Architettura/arch1.odp page 16
  17. 17. Layout di pagina testdb=#             SELECT relname,oid,relpages,reltuples from pg_class where relname  ilike 'test%';     relname     |  oid  | relpages | reltuples  ­­­­­­­­­­­­­­­­­­­­­­+­­­­­­­+­­­­­­­­­­+­­­­­­­­­­­  testtb_id_seq  | 16385 |        1 |         1  testtb         | 16387 |        0 |         0  testtb_pkey   | 16391 |        1 |         0 → viene creato un indice unico (3 rows) 27/11/08 /home/scotty/enrico/corso­web/finale/Architettura/arch1.odp page 17
  18. 18. Architettura di storage Cluster Databases Tabelle Indici Blocchi 27/11/08 /home/scotty/enrico/corso­web/finale/Architettura/arch1.odp page 18

×