DB_CH5
DB_CH5
Logical ERD
Logical ERD is a detailed version of a Conceptual ERD.
A logical ER model is developed to enrich a conceptual model by defining explicitly the
columns in each entity and introducing operational and transactional entities.
Revision cont…
Physical ERD
It represents the actual design blueprint of a relational database. It elaborates on the
logical data model by assigning each column with type, length, nullable, etc.
Since a physical ERD represents how data should be structured and related in a specific
DBMS it is important to consider the convention and restriction of the actual database
system in which the database will be created.
Make sure the column types are supported by the DBMS and reserved words are not
used in naming entities and columns.
Revision cont….
Summary
Introduction
▪ Physical database design is the process of transforming logical data models into
physical data models.
▪ Its Purpose is to translate the logical description of data into technical specifications
for storing and retrieving data.
▪ Information needed for physical file and database design includes:
▪ Normalized relations plus their size estimate
▪ Expectations and requirements for response time, data security, backup & recovery,
retention and integrity
▪ Descriptions of where and when data are used, entered, retrieved, deleted, updated, and
how often
▪ Descriptions of the technologies used to implement the database
▪ Definitions of attributes in the tables
Physical Database Design Process: Inputs
✓ Tables produced by logical database design
✓ Normalized tables
✓ Business environment requirements
✓ Response time: delay from the time that the enter key is pressed to execute a
query and the result appears on the screen.
✓ Throughput: measure of how many queries from simultaneous users must
be responded in a given period of time by the application and the database
that supports it.
✓ Data characteristics
✓ Data volume assessment: how much data will be in the database, roughly
how many records is each table expected to have?
✓ Data volatility: refers to how often stored data is updated, deleted?...
Cont…
✓ Application characteristics
✓ Which applications are the most important to the company?
✓ What is the nature of applications that will use the data?
✓ Which data will be accessed by each application?
✓ Application data requirements
✓ Application priorities
Cont…
Operational Requirements
◦ Security : protecting data from theft or malicious destruction and making
sure that sensitive data is accessible only to those who are concerned.
◦ Backup & recovery:
Backup: copy of the entire data to ensure database safety.
Recovery: being able to recover a table or database that has been
corrupted or lost due to hardware or software failure.
Hardware and Software Characteristics
◦ DBMS Xcs: Attribute data type options, and SQL query features, which
must be known and taken into account during physical database design.
◦ Hardware Xcs: Processor speeds and disk data transfer rates.
Things to be analyzed by Database Designers cont…
▪ Secondary storage
▪ Tertiary storage
Con’t…
Primary storage
▪ It includes storage media that store a data which can be operated
directly by the computer central processing unit (CPU).
▪ Primary storage includes;
▪ The computer main memory (RAM) and
▪ Smaller but faster cache memories.
▪ Primary storage usually provides fast read and write to data. It is of
limited storage capacity.
▪ Primary storage devices are more expensive.
▪ The contents of main memory are lost in case maybe when power
failure, a system crash or other issue occurs.
Cont…
Secondary storage
▪ Includes large storage devices such as computer hard disk (HDD) and SSD.
▪ These devices usually have
▪ A larger capacity,
▪ Less cost, and
▪ Provide slower access to data than primary storage devices.
▪ Data in secondary storage cannot be processed directly by the CPU, it must
first be copied into primary storage.
▪ They are called online storage devices because they can be accessed in short
period of time whenever needed.
Tertiary storage
▪ Optical disks (CD-ROMs, DVDs, and other similar storage media) and
magnetic tapes which are removable media are used in today’s systems as
offline storage for archiving databases.
Memory Hierarchies and Storage Devices
Memory hierarchies
Cont…
Storage capacity, access speed and cost comparison, as we move
from one level to the other
Data Storage in Databases
Data stored in databases
◦ Persistent data
◦ Temporary data
Databases typically store large amounts of data that must
persist over long periods of time.
◦ This is the reason that the data is often referred to as persistent
data.
Parts of this data are accessed and processed repeatedly.
Parts of the data may be accesses and processes very rarely.
Transient/temporary data: persists for only a limited time
during program execution.
Cont…
▪ There must be some query that uses that attribute either in a selection or a join condition.
▪ If a table requires several indexes, the decision about which one should be
the primary or clustering index depends upon whether keeping the table
ordered on that attribute is needed.
Cont…
▪ Design decisions about indexing
▪ Whether to use a hash index over a tree index: RDBMSs can use B+
trees for indexing.
▪ Whether to use dynamic hashing for the file: for files that are very
volatile → those that grow and shrink continuously, one of the
dynamic hashing schemes would be suitable.
Index Types
▪ Index
▪ Dense
▪ Sparse
▪ Single Level
▪ Multilevel
▪ Single level ordered indexes
▪ Primary index,
▪ Secondary,and
▪ Clustering
▪ Multilevel indexes
▪ Search tree
▪ B -tree
▪ B+ -tree
Dense Vs Sparse Index
Dense :
▪ An index entry is created for every search key value (for each records) in
each block.
▪ This index contains search key value and a pointer to the actual record.
▪ Large index size
▪ Less time needed to locate arbitrary data.
Sparse :
▪ One index entry for each block.
▪ Indexes are created only for some of the data records.
▪ Small index size
▪ More time needed to locate arbitrary data
▪ Records must be clustered or arranged in blocks
▪ Faster write
Cont…
Dense Indexing
Sparse Indexing
Reading assignment (Have at least a highlight understanding about
the following)
▪ Primary index
▪ Clustering index
▪ Secondary index
▪ Multilevel Index (Search tree, B –tree, B+ -tree)
▪ Dynamic multilevel indexes using B-Trees & B+ Trees
▪ Indexes on multiple indexes
▪ Query Optimization
Thank you !!!