Database Management System Overview and Operations

Milestone 1
BLANK
Kai Janowicz, Bilal Pervaiz,
 
Niraj Bangari, Andrew
Lam, and Laura Ehrlich
1
D
a
t
a
 
M
o
d
e
l
Overview
2
Database Storage
Base + Tail Pages
Page Range
Select
Insert
Update
Sum
Page Directory
Index Directory
B
u
f
f
e
r
p
o
o
l
M
a
n
a
g
e
m
e
n
t
Q
u
e
r
y
 
I
n
t
e
r
f
a
c
e
R
e
s
u
l
t
s
Speed
Data Model
4
Storage
A physical
Page
# of columns +
Metadata Count = # of
physical pages
Metadata
Indirection, RID/TID,
Timestamp, Schema
Encoding, update count
Column-based database
User
Data
4096 kb
8 bytes per record
Base + Tail
Pages
Holds 512 records per
page
5
Page Range
Stores 8192 records
1 full page range
Tail Page
Base
Pages
 Holds 16 base pages
Unlimited Tail Pages to
hold all updates
Bufferpool
Management
Page Directory
7
{RID, Page Range}
8
Index Directory
List of Dictionaries
-
One dict per column
-
Each data value maps to a list of
Rids
[{},{},{},{}]
[Rid, Rid,Rid]
RID
User Data (key)
Query
Interface
10
Insert
 
 
Query
-Record input
-Calls table.insert
-increment RID
-PageRange for first insert
-add primary key to rid hashtable
-Checks for PageRange and
BasePage space
-Creates data column to be
inserted into physical pages of
BasePage
Table
If space
If not
If there is still PageRange capacity,
add BasePage
If there is not PageRange capacity,
create a new PageRange
Insert records into physical pages
of BP
-calls create.index, which passes
data column and rid to make
hashtable for values
Index
Record
-contains RID, primary key,
columns
11
Select
Index
Query
Input goes
into query
Calls Select
Calls Separate Select
Table
Finds Location in Index
Returns the RID of every
occurrence of the Inputted
Key & the Column Index
Index
Returns List of RIDS
Calls Internal
Function
“select_w_rid”
Finds most recent version of every
record
Table.select_w_rid
Returns
Record
Calculates where TID/RID
is located in the data
User Defined
Page Range
pr.get / pr.get_uptodate
Return Record
12
Sum
Calls Sum. Passes
each Key in the range
Query
Input Key
Range and
Column that is
going to be
summed
 
Checks if Key exists. Find
location and return record
holding specified column.
Table.select_for_me
Calculates where TID/RID
is located in the data.
User Defined
Page Range
pr.get / pr.get_uptodate
Return Record
13
Update Cumulative
What to keep track of
-
Indirection Column
-
Update_Count Column
-
Col to update
Update Steps
1.
Space in Tail page
2.
Basepage Indirection Col 
3.
Indirection Col and Update_Count
4.
Write to the Tail Page
5.
Update the metadata in the Tail page
Query
Calls to update a
Record
Point Basepage to the Newest
Version
Point newest to previous
location
Table
Make the New Indexes
Index
14
Select_Version & Sum_Version
Draw Backs:
-
Only works with Primary keys
My Assumptions
-
If requested version is larger
than the update number then
return the first entry.
My Implementation:
Jumping to versions through the
indirection column
Visual Representation:
I want version -1 of rid 0
Base
Tail
15
Delete
What to do:
-
Update the index
-
Change Rid to -1 to signal a
delete
Query
Calls to delete on a
certain Record
Gives Key and what
to update
Finds the Rid using the Index
Calls delete and places -1 in
the Rid Col
Table
Remove deleted data
mappings in the Index
Index
Results
17
BIG 0 RESULTS FOR QUERY OPERATIONS
INSERT: INSERT NEW TABLE or NEED TO UPDATE/ADD PAGERANGE AND BASE PAGE
-
Inserting a record & setup index: 
-
BIG-O: O(2N); N = COLUMN NUMBERS 
-
NEW BASE PAGES AND PAGE RANGE: O(1) 
-
O(2N) (WORST CASE)
SELECT: SELECT FROM DATABASE BASED ON GIVEN CRITERIA 
-
LOOKING FOR ALL COLUMNS 
-
O(N) (WORST CASE)
DELETE: DELETE A RECORD FROM THE DATABASE
-
THIS DELETES THE BASE PAGE FROM THE PAGE RANGE
-
REMOVES THE RECORD FROM THE INDEX
-
BIG-O: O(N). N IS NUMBER OF COLUMNS
18
BIG O RESULTS FOR QUERY
OPERATIONS:    CONTINUED
SUM: CONSTANT TIME
-
 ARITHMETIC; SUMMING FROM A TO B
-
O(1)
UPDATE: UPDATING A RECORD. EACH UPDATES COLUMN WILL HAVE THEIR OWN TAIL PAGE
-
EACH ADDITIONAL UPDATED GETS THEIR OWN TAIL PAGE
-
UPDATE BOTH THE INDEX AND ADD THE PAGE RANGE WITH THE TAIL PAGES AS NEEDED
-
WORST CASE: ALL COLUMNS NEED A NEW TAIL PAGE
-
O(N), N IS THE COLUMN NUMBER
19
Results
Specs
-Ram 16gb ddr4
-i5-12400 2.5ghz
20
Thanks
!
21
Slide Note
Embed
Share

In this content, we explore various aspects of a database management system including data models, storage management, bufferpool management, and query interfaces. From page ranges to index directories, the system is designed to efficiently store, retrieve, and manipulate data, ensuring optimal performance and scalability.

  • Database Management
  • Data Models
  • Storage Management
  • Query Interfaces
  • System Operations

Uploaded on Aug 31, 2024 | 0 Views


Download Presentation

Please find below an Image/Link to download the presentation.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.

You are allowed to download the files provided on this website for personal or commercial use, subject to the condition that they are used lawfully. All files are the property of their respective owners.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.

E N D

Presentation Transcript


  1. Milestone 1 BLANK Kai Janowicz, Bilal Pervaiz, Niraj Bangari, Andrew Lam, and Laura Ehrlich 1

  2. Overview Query Interface Data Model Database Storage Base + Tail Pages Page Range Select Insert Update Sum 1 3 Results Speed 4 2 Bufferpool Management Page Directory Index Directory 2

  3. Data Model 1

  4. Storage Column-based database User Data Metadata Indirection, RID/TID, Timestamp, Schema Encoding, update count Base + Tail Pages Holds 512 records per page A physical Page # of columns + Metadata Count = # of physical pages 4096 kb 8 bytes per record 4

  5. Page Range Stores 8192 records 1 full page range Base Pages Holds 16 base pages Tail Page Unlimited Tail Pages to hold all updates 5

  6. Bufferpool Management 2

  7. Page Directory RID 1 {RID, Page Range} Page Range 2 Base Page. 3 7

  8. Index Directory List of Dictionaries - - One dict per column Each data value maps to a list of Rids User Data (key) RID [{},{},{},{}] [Rid, Rid,Rid] 8

  9. Query Interface 3

  10. Insert Record -Record input -Calls table.insert -increment RID Query -contains RID, primary key, columns If not -PageRange for first insert -add primary key to rid hashtable -Checks for PageRange and BasePage space -Creates data column to be inserted into physical pages of BasePage If there is still PageRange capacity, add BasePage Table If there is not PageRange capacity, create a new PageRange Index If space -calls create.index, which passes data column and rid to make hashtable for values Insert records into physical pages of BP 10

  11. Select Index Index Returns the RID of every occurrence of the Inputted Key & the Column Index Table Query Input goes into query Calls Select Calls Separate Select Calls Internal Function select_w_rid Returns Record User Defined Page Range Table.select_w_rid pr.get / pr.get_uptodate Calculates where TID/RID is located in the data Finds most recent version of every record Return Record 11

  12. Sum User Defined Page Range Table.select_for_me Query pr.get / pr.get_uptodate Input Key Range and Column that is going to be summed Checks if Key exists. Find location and return record holding specified column. Calls Sum. Passes each Key in the range Calculates where TID/RID is located in the data. Return Record 12

  13. Update Cumulative Calls to update a Record Query What to keep track of - Indirection Column - Update_Count Column - Col to update Point Basepage to the Newest Version Point newest to previous location Table Update Steps 1. Space in Tail page 2. Basepage Indirection Col 3. Indirection Col and Update_Count 4. Write to the Tail Page 5. Update the metadata in the Tail page Make the New Indexes Index 13

  14. Select_Version & Sum_Version Visual Representation: I want version -1 of rid 0 Draw Backs: - Only works with Primary keys Base My Assumptions - If requested version is larger than the update number then return the first entry. ind RID val 3 0 5 0 1 6 My Implementation: Tail 0 2 4 Jumping to versions through the indirection column ind TID val 0 1 8 1 2 6 2 3 4 14

  15. Delete Calls to delete on a certain Record Query Gives Key and what to update What to do: - Update the index - Change Rid to -1 to signal a delete Finds the Rid using the Index Calls delete and places -1 in the Rid Col Table Remove deleted data mappings in the Index Index 15

  16. Results 4

  17. BIG 0 RESULTS FOR QUERY OPERATIONS INSERT: INSERT NEW TABLE or NEED TO UPDATE/ADD PAGERANGE AND BASE PAGE - Inserting a record & setup index: - BIG-O: O(2N); N = COLUMN NUMBERS - NEW BASE PAGES AND PAGE RANGE: O(1) - O(2N) (WORST CASE) SELECT: SELECT FROM DATABASE BASED ON GIVEN CRITERIA - LOOKING FOR ALL COLUMNS - O(N) (WORST CASE) DELETE: DELETE A RECORD FROM THE DATABASE - THIS DELETES THE BASE PAGE FROM THE PAGE RANGE - REMOVES THE RECORD FROM THE INDEX - BIG-O: O(N). N IS NUMBER OF COLUMNS 17

  18. BIG O RESULTS FOR QUERY OPERATIONS: CONTINUED SUM: CONSTANT TIME - ARITHMETIC; SUMMING FROM A TO B - O(1) UPDATE: UPDATING A RECORD. EACH UPDATES COLUMN WILL HAVE THEIR OWN TAIL PAGE - EACH ADDITIONAL UPDATED GETS THEIR OWN TAIL PAGE - UPDATE BOTH THE INDEX AND ADD THE PAGE RANGE WITH THE TAIL PAGES AS NEEDED - WORST CASE: ALL COLUMNS NEED A NEW TAIL PAGE - O(N), N IS THE COLUMN NUMBER 18

  19. Results Specs -Ram 16gb ddr4 -i5-12400 2.5ghz 19

  20. Thanks ! 20

  21. 21

More Related Content

giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#