# Part

Classified in Computers

Written at on English with a size of 1.77 KB.

2009 **problem** 1: primary index contains primary key (T), hash good for equality selection (T), hash worse than sorted for equality searchj (F), sorted worse for range queries (F), data entries can be records (F). Left-deep doesn't pipeline (F), sort-merge cost (T), probing cost is M*N (F), flattened sql faster (T), query optimize 2 part (T)

problem 2 a) R natjoin S yields min=0, max=M x N

problem 3 b) pipeline = continuous stream of query calls, c) left deep **join** = efficient join due to pipeline, join all the way on left first, draw tree

RahulQUIZ2 problem 1: R(ABC)F={A->B} decomp to S(A,B) and T(B,C) give instance who proj not same

ans: original has table with column A(smith,jacobs,adams), B(**bob**,bob,john), C(42,12,18). Now AB natjoin BC gives Bob Smith can be 42 or 12, Bob Jacobs can be 12 or 42. So not equal.

problem 2: if we decomp R(ABCDE) to (ABC),(ADE) with F={A->BC,CD->E,B->D,E->A} show it is lossless-join

ans: R1(ABC)F1{A->BC}, R2(ADE)F2{E->A}. To be lossless, (R1 n R2) -> R1 or R2, so (R1 n R2) = A, and A+ =ABCDE and A->BC is in F, A->ABC, so (R1nR2) = R1 is in F,lossles

definitions:

JDBC: 4 parts: application(connections,submit sql), Driver manager(JDBC driver), Driver(connect to source,transmit data), Data source(process sql statements)

Index files: consist of records in search-key&pointer form

Disadvantage of index-seq **file**: performace degrades as file grows, need organization of file. Advatage of B+: automatically reorganizes, itself w/ small changes. Disadvantage of B+: extra space overhead