Database Management Systems (Database Design and Tuning)

Database Management Systems

Part 6: Database Design and Tuning

Chapter 19. Schema refinement and normal forms

problems caused by redundancy: redundant storage, update anomalies, insertion anomalies, deletion anomalies

functional dependency (FD): a kind of IC that generalizes the concept of a key. FD X->Y if t1.X = t2.X then t1.Y = t2.Y

  --> decomposition of a relation schema: normal forms; properties: lossless-join, dependency-preservation

FD does not require that set X be minimal; a primary key constraint is a special case of an FD, key is X and the set of all attributes is Y

FD f is implied by a given set F of FDs if f holds on every relation instance that satisfies all dependencies in F --> the set of all FDs implied by a given set F of FDs is called the closure of F, denoted as F+

how to infer/compute the closure F+: Armstrong's Axioms: sound and complete

reflexivity: if X is a superset of Y, then X->Y

augmentation: if X->Y, then XZ->YZ for any Z

transitivity: if X->Y and Y->Z, then X->Z

additional rules: union: if X->Y and X->Z, then X->YZ; decomposition: if X->YZ, then X->Y and X->Z

attribute closure X+: set of attributes A such that X->A can be inferred <-- check whether a given dependency X->Y is in the closure F+; find all candidate keys


normal forms: if a relation schema is in one of the normal forms, we know that certain kinds of problems cannot arise.

1NF, 2NF, 3NF, Boyce-Codd normal form (BCNF) <-- increasingly restrictive requirements

1NF: every field contains only atomic values, no lists or sets (implicit in the definition of the relational model)

BCNF: X is a subset of attributes, A is an attribute, for every FD X->A in F, one of the following is true: A \in X (a trivial FD) or X is a superkey

(in a BCNF relation, the only nontrivial dependencies are those in which a key determines some attributes)

BCNF ensures that no redundancy can be detected using FD information alone

3NF: for every FD X->A in F, one of the following is true: A \in X, or X is a superkey, or A is part of some key (any key if there are several) for R

every BCNF relation is also in 3NF

(finding all keys of a relation schema is known to be an NP-complete problem, and so is the problem of determining whether a relation schema is in 3NF)

X->A violates 3NF: 2 cases: (1) X is a proper subset of some key K: partial dependency, (2) X is not a proper subset of any key: transitive dependency


motivation for 3NF: by making an exception for certain dependencies involving key attributes, we can ensure that every relation schema can be decomposed into a collection of 3NF relations using only decompositions that have certain desirable properties (such a guarantee does not exist for BCNF relations, but some redundancy is possible with 3NF)

2NF: partial dependencies are not allowed


lossless-join decomposition: for every instance r of R that satisfies dependencies in F, \pi_X(r) \naturaljoin \pi_Y(r) = r, i.e. we can recover the original relation from the decomposed relations

theorem: lossless iff. F+ contains either FD R1 \intersect R2 -> R1 or the FD R1 \intersect R2 -> R2, i.e. the attributes common to R1 and R2 must contain a key for either R1 or R2

==> if an FD X->Y holds over a relation R and X \intersect Y is empty, the decomposition of R into R - Y and XY is lossless

dependency-preserving decomposition: allows to enforce all FDs by examining a single relation instance on each insertion or modification of a tuple (deletions cannot cause violation of FDs) -- (F_X \union F_Y)+ = F+

projection of F on X: set of FDs in the closure F+ that involve only attributes in X; a dependency U->V in F+ is in F_X only if all attributes in U and V are in X


if a relation schema is not in BCNF, it is possible to obtain a lossless-join decomposition into a collection of BCNF relation schemas, but there may be no dependency-preserving decomposition into a collection of BCNF relation schemas

there is always a dependency-preserving, lossless-join decomposition into a collection of 3NF relation schemas

decompose into BCNF:

(1) suppose R is not in BCNF. let X \subset R, A be a single attribute in R, and X->A be an FD that causes a violation of BCNF. decompose R into R-A and XA

(2) if either R-A or XA is not in BCNF, decompose them further by recursive application of this algorithm

==> it cannot discriminate among decomposition alternatives (depending on which dependencies we choose to guide the next decomposition step)

decompose into 3NF (omitted)

need a schema refinement step following ER design

other kinds of dependencies (omitted)




Chapter 20. Physical database design and tuning








Chapter 21. Security and authorization

three main objectives: secrecy, integrity, availability --> security policy --> security mechanisms

other factors: security leaks in OS or network, human factors

views: limit access to sensitive data; authenticate for e-commerce applications

access control: discretionary or mandatory

discretionary access control: access rights, or privileges -- allow user to access data object in certain manner (read or modify): GRANT and REVOKE in SQL

mandatory access control: systemwide policies that cannot be changed by individual users -- database object: security class; user: clearance


GRANT:

GRANT privileges ON object TO users [ WITH GRANT OPTION ]
several privileges can be specified: SELECT(read, including columns added later through ALTER TABLE), INSERT(column-name, omit for all columns), UPDATE(column-name), DELETE, REFERENCES(column-name, define foreign keys)

If a user has a privilege with the grant option, he or she can pass it to another user by using the GRANT command; a user who creates a base table has all applicable privileges on it; a user who creates a view has precisely those privileges on the view that the user has on every one of the views or base tables used to define the view.

only owner of a schema can CREATE, ALTER, and DROP -- these cannot be granted or revoked

(role-based authorization: CREATE ROLE, DROP ROLE)

privileges are assigned to authorization IDs (a single user of a group of users) -- examples in Sec 21.3

REVOKE:

REVOKE [ GRANT OPTION FOR ] privileges ON object FROM users { RESTRICT | CASCADE }
one of restrict or cascade must be specified

when a GRANT is executed, a privilege descriptor is added to a table maintained by DBMS -- grantor, grantee, granted privilege, whether grant option is included

authorization graph:


revoke should ensure: if node N has an outgoing arc labeled with a privilege, there is a path from the System node to node N in which each arc label contains the same privilege plus the grant option.

grant and revoke on views and integrity constraints: 1. a view may be dropped because a SELECT privilege is revoked from the user who created the view; 2. if the creator of a view gains additional privileges on the underlying tables, he or she automatically gains additional privileges on the view; 3. the distinction between REFERENCES and SELECT is important. (examples in Sec 21.3.1)

mandatory access control (omitted)

security for internet applications: encryption, certificates, digital signatures


role of DBA: system account --> 1. creating new accounts; 2. mandatory control issues

security in statistical databases: intend to permit only statistical queries --> challenge: it is possible to infer protected information from answers to permitted statistical queries

solution: require each query must involve at least some minimum number of rows --> better to limit on the amount of intersection permitted between queries


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
PID控制器是一种常用的自动控制系统设计方法,用于实现稳定的反馈控制。PID控制器的设计基于PID控制的理论原理和调节方法。该理论原理源于控制系统的反馈原理和增益裕度的概念。 PID控制器由比例(P)、积分(I)和微分(D)三个控制部分组成。比例控制部分通过将控制操作量与误差的比例关系来调整系统的动态响应速度。积分控制部分通过累积误差来调整系统的静态稳定性。微分控制部分则通过检测误差变化率来调整系统的快速响应能力。 PID控制器的设计需要根据具体的控制系统要求和性能指标进行调整。通常,比例增益值用于调整系统的稳定性和动态响应速度。积分时间常数用于消除系统的稳态误差。微分时间常数用于减小系统的过冲和抑制振荡。 为了提高PID控制器的性能和稳定性,需要进行PID控制器的调优。调优的目标是找到合适的PID参数值来实现系统的最佳性能。常用的调优方法包括试验法、经验法、模型法和自适应法等。试验法通过实际操作和观察系统响应来调整PID参数。经验法则基于经验公式或经验规则来选择PID参数。模型法则利用控制系统的数学模型和理论分析方法来确定PID参数。自适应法则根据系统的实时响应来动态调整PID参数。 PID控制器的理论设计和调优是控制工程领域的重要课题,对于实现自动控制系统的稳定和优化具有重要意义。充分理解PID控制器的原理和调优方法,能够有效设计和优化控制系统,提高系统的性能和稳定性。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值