f Flashcards
(123 cards)
Aggregation:
Used to model a relationship involving a relationship set
Allows us to treat a relationship set as an entity set for purposes of participation in other relationships
Lowest-level ER model:
physical data model (PDM) – most detailed
is ER design subjective
Yes
Entity:
real-world object, distinguishable from other objects. An entity is described as using a set of attributes.
Reasons to use ISA:
Add descriptive attributes specific to a subclass (ex. Not appropriate for all entities in the superclass)
Identify entities that participate in a particular relationship (ex. Not all superclass entities participate)
Weak Entity:
Weak entity can be identified uniquely only by considering the primary key of another (owner) entity.
Weak entity set must have total participation in this identifying relationship set.
Weak entities only have a “partial key” (dashed underline)
The steps:
- Identify the entities
- Identify the relationships between the entities
- Determine whether a relationship is 1:1 1:M or M:N
- Determine whether participation in a relationship mandatory (At least one instance or full participation) or not
- Identify weak entities
- Identify ISA hierarchies and aggregations
- Consider possible refinements: should a concept be modeled as an entity or attribute? Should a concept be modeled as an entity or a relationship? Identifying relationships? Binary or ternary?
Mid-level ER model:
Logical data model (LDM)
In translation a relationship set to a relation, attributes of the relation must include(3):
- keys for each participating entity set (as foreign keys)
- this set of attributes forms a superkey for the relation
- all descriptive attributes
Owner entity set and weak entity set must participate in
Owner entity set and weak entity set must participate in a one-to-many relationship set (one owner, many weak entities).
Entity set:
a connection of similar entities (ex. All employees). All entities in an entity set have the same set of attributes, each entity set has a key (underlined), each attribute has a domain.
Locks and transaction design:
When you change a row, no one else can modify it until you issue a COMMIT, try not to hold locks for too long since it will slow down other sessions
Two biggest causes of contention are
locks and latches (or mutexes)
Types of contention (3):
locks
latches and mutex
buffer contention
Two ways to design transaction locking?
Pessimistic and Optimistic
Contention prevents:
Contention prevents the database from working on all of the requests that are outstanding
High-level ER model:
Conceptual data model (CDM)
Contention is another word for
bottleneck
Pessimistic locking:
works best if you think someone else is going to “grab” your row before you are finished
Hints:
You can add a hint to your SQL to change the execution plan
SELECT /* index(index name) */
Performance problems are often seen as
unacceptable response time or throughput
Are indexes good for small or large amount of the tables?
Indexes are only good for getting small amount of the table
Tuning involves
proactive monitoring and bottleneck elimination, providing room for system scalability (process more workload)
Partitioning:
Split table up to make them smaller