SlideShare uma empresa Scribd logo
1 de 15
Baixar para ler offline
LA QUESTIONE DEL TEMPO NEI DATI: 
DATABASE TEMPORALI 
! 
Andrea Gottardi
Introduzione 
I database non sempre rappresentano la realtà 
Molto spesso, nella versione generalmente utilizzata, 
non trattano il tempo 
I database temporali sono nati per colmare il 
(potenziale) divario tra situazione registrata e realtà
Evoluzione della tecnologia 
Ben-Zvi (1982) e Clifford (1983): prima formalizzazione 
Tempo effettivo e tempo di registrazione 
Snodgrass (fine anni 80) 
Miglioramento linguaggio QUEL 
Estensione di SQL-92 (TSQL) 
Fondamenti di SQL3
Concetti fondamentali 
I database temporali sono caratterizzati da tre aspetti: 
Tipi di dato temporale 
Tipi di tempo utilizzabili 
Tipi di interrogazioni
Tipi di dato temporale 
Istanti 
Un momento preciso nel tempo 
Intervalli 
Una quantità di tempo definita 
Periodi 
La naturale unione tra istanti e intervalli 
Hanno una gestione particolare (relazioni, rappresentazione)
Tipi di tempo 
“User-defined time” 
Sono paragonabili a qualsiasi altro campo 
Tempo di transazione 
Quando la modifica viene registrata 
Tempo di validità 
Quando la modifica vale effettivamente
Tipi di interrogazioni 
Interrogazioni correnti 
Prendono in considerazione l’istante attuale 
Interrogazioni sequenziali 
Considerano tutto il tempo conosciuto 
Interrogazioni non sequenziali 
Danno importanza solo ai valori diversi dal tempo
Tabelle temporali 
Sono tre tipi, e presentano particolarità diverse: 
Tabelle con tempo di validità 
Tabelle con tempo di transazione 
Tabelle bitemporali
Tabelle con tempo di validità 
Registrano il tempo in cui il record ha validità reale 
! 
RESIDENZA 
ID Nome Residenza Start End 
1 Mario Rossi Trento 03.05.1984 31.12.9999 
2 Giorgio Bianchi Lavis 06.03.1992 20.07.2014 
2 Giorgio Bianchi Trento 20.07.2014 31.12.9999
Tabelle con tempo di transazione 
Registrano il tempo in cui il record si “ritiene valido” 
Servono per consentire il ripristino del sistema in ogni 
istante passato 
È sempre necessario inserire un nuovo record per ogni 
modifica 
! RICH_RESIDENZA 
ID Nome Residenza Tran_Start Tran_End 
1 Mario Rossi Trento 28.04.1984 31.12.9999 
2 Giorgio Bianchi Lavis 03.03.1992 17.07.2014 
2 Giorgio Bianchi Trento 17.07.2014 31.12.9999
Tabelle bitemporali 
Unione tra le tabelle con tempo di validità e tabelle con 
tempo di transazione 
Hanno una gestione più potente, ma anche più complessa: 
Le operazioni di modifica subiscono notevoli 
cambiamenti per ottenere lo stesso risultato 
Non sono molto utilizzate: la difficoltà di gestione rende 
preferibile usare due tabelle, più flessibili e facili da 
mantenere
Tabelle bitemporali 
! 
! 
PERSONALE 
ID Nome Grado Val_Start Val_End Tran_Start Tran_End 
1 Luca Verdi 2 01.07.2005 31.12.9999 10.06.2005 01.11.2014 
2 Paolo Rossi 2 01.02.2009 31.12.9999 11.01.2009 15.07.2014 
2 Paolo Rossi 2 01.02.2009 01.08.2014 15.07.2014 31.12.9999 
2 Paolo Rossi 1 01.08.2014 31.12.9999 15.07.2014 31.12.9999 
1 Luca Verdi 2 01.07.2005 01.01.2015 01.11.2014 31.12.9999
Fondazione Bruno Kessler 
FBK utilizza i database temporali, anche se con alcune 
varianti rispetto alla teoria originaria 
Vengono usate solo tabelle con tempo di validità, 
La possibilità di ripristino si ottiene comunque, ma 
in altro modo 
Per questo motivo non vengono utilizzate 
nemmeno le tabelle bitemporali
Conclusioni 
I database temporali sono una soluzione fondamentale 
se è necessario avere dati coerenti in ogni momento 
Le strategie di utilizzo, a seconda delle esigenze, 
possono essere molto diverse 
Molte sono gli aspetti ancora da perfezionare, ma 
l’ultima versione dello standard ha permesso notevoli 
miglioramenti
GRAZIE PER L'ATTENZIONE

Mais conteúdo relacionado

Destaque

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
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
 

Destaque (20)

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...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 

La questione del tempo nei dati - Database Temporali

  • 1. LA QUESTIONE DEL TEMPO NEI DATI: DATABASE TEMPORALI ! Andrea Gottardi
  • 2. Introduzione I database non sempre rappresentano la realtà Molto spesso, nella versione generalmente utilizzata, non trattano il tempo I database temporali sono nati per colmare il (potenziale) divario tra situazione registrata e realtà
  • 3. Evoluzione della tecnologia Ben-Zvi (1982) e Clifford (1983): prima formalizzazione Tempo effettivo e tempo di registrazione Snodgrass (fine anni 80) Miglioramento linguaggio QUEL Estensione di SQL-92 (TSQL) Fondamenti di SQL3
  • 4. Concetti fondamentali I database temporali sono caratterizzati da tre aspetti: Tipi di dato temporale Tipi di tempo utilizzabili Tipi di interrogazioni
  • 5. Tipi di dato temporale Istanti Un momento preciso nel tempo Intervalli Una quantità di tempo definita Periodi La naturale unione tra istanti e intervalli Hanno una gestione particolare (relazioni, rappresentazione)
  • 6. Tipi di tempo “User-defined time” Sono paragonabili a qualsiasi altro campo Tempo di transazione Quando la modifica viene registrata Tempo di validità Quando la modifica vale effettivamente
  • 7. Tipi di interrogazioni Interrogazioni correnti Prendono in considerazione l’istante attuale Interrogazioni sequenziali Considerano tutto il tempo conosciuto Interrogazioni non sequenziali Danno importanza solo ai valori diversi dal tempo
  • 8. Tabelle temporali Sono tre tipi, e presentano particolarità diverse: Tabelle con tempo di validità Tabelle con tempo di transazione Tabelle bitemporali
  • 9. Tabelle con tempo di validità Registrano il tempo in cui il record ha validità reale ! RESIDENZA ID Nome Residenza Start End 1 Mario Rossi Trento 03.05.1984 31.12.9999 2 Giorgio Bianchi Lavis 06.03.1992 20.07.2014 2 Giorgio Bianchi Trento 20.07.2014 31.12.9999
  • 10. Tabelle con tempo di transazione Registrano il tempo in cui il record si “ritiene valido” Servono per consentire il ripristino del sistema in ogni istante passato È sempre necessario inserire un nuovo record per ogni modifica ! RICH_RESIDENZA ID Nome Residenza Tran_Start Tran_End 1 Mario Rossi Trento 28.04.1984 31.12.9999 2 Giorgio Bianchi Lavis 03.03.1992 17.07.2014 2 Giorgio Bianchi Trento 17.07.2014 31.12.9999
  • 11. Tabelle bitemporali Unione tra le tabelle con tempo di validità e tabelle con tempo di transazione Hanno una gestione più potente, ma anche più complessa: Le operazioni di modifica subiscono notevoli cambiamenti per ottenere lo stesso risultato Non sono molto utilizzate: la difficoltà di gestione rende preferibile usare due tabelle, più flessibili e facili da mantenere
  • 12. Tabelle bitemporali ! ! PERSONALE ID Nome Grado Val_Start Val_End Tran_Start Tran_End 1 Luca Verdi 2 01.07.2005 31.12.9999 10.06.2005 01.11.2014 2 Paolo Rossi 2 01.02.2009 31.12.9999 11.01.2009 15.07.2014 2 Paolo Rossi 2 01.02.2009 01.08.2014 15.07.2014 31.12.9999 2 Paolo Rossi 1 01.08.2014 31.12.9999 15.07.2014 31.12.9999 1 Luca Verdi 2 01.07.2005 01.01.2015 01.11.2014 31.12.9999
  • 13. Fondazione Bruno Kessler FBK utilizza i database temporali, anche se con alcune varianti rispetto alla teoria originaria Vengono usate solo tabelle con tempo di validità, La possibilità di ripristino si ottiene comunque, ma in altro modo Per questo motivo non vengono utilizzate nemmeno le tabelle bitemporali
  • 14. Conclusioni I database temporali sono una soluzione fondamentale se è necessario avere dati coerenti in ogni momento Le strategie di utilizzo, a seconda delle esigenze, possono essere molto diverse Molte sono gli aspetti ancora da perfezionare, ma l’ultima versione dello standard ha permesso notevoli miglioramenti