cs4432 - week 5

51 flashcardsby alicia
Study these flashcardsFree · spaced repetition · iPhone, Android, Mac & web

All cards

1
What is disk based hash indexing?
an adaptation of main memory hash tables for databases
2
What type of queries do hash indexes support?
equality searches
3
Do hash indexes support range queries?
no
4
What is static hashing?
hashing where number of buckets n is fixed
5
What does each bucket represent in static hashing?
one disk page
6
What does a hash function do?
maps a key to a bucket
7
What is a common hash function?
h key mod n
8
What is required of a good hash function?
uniform distribution of keys
9
What must a hash function be?
deterministic
10
What is stored in a hash bucket entry?
key and rid
11
What is a rid?
record id consisting of block id and slot number
12
Should entries in a bucket be sorted?
yes for faster search
13
What is the tradeoff of sorting bucket entries?
slower insert and delete
14
How does lookup in hashing work?
apply hash function then search bucket
15
What extra step is needed during lookup?
check overflow buckets if they exist
16
What happens when a bucket is full?
create overflow bucket
17
What is an overflow bucket?
an additional disk block linked to a bucket
18
What is a drawback of overflow buckets?
long chains slow search
19
What is deletion in static hashing?
remove key and possibly remove overflow bucket
20
What is a major limitation of static hashing?
number of buckets cannot change
21
What is dynamic hashing?
hashing where number of buckets can grow
22
What problem does dynamic hashing solve?
avoids overflow buckets
23
What is extensible hashing?
a dynamic hashing method using a directory
24
What is a directory in extensible hashing?
array of pointers to buckets
25
What determines directory size?
global depth
26
What is global depth?
number of bits used for indexing
27
What is local depth?
number of bits used by a bucket
28
What must be true about local depth?
less than or equal to global depth
29
How do you determine a bucket in extensible hashing?
use least significant bits of hash
30
What happens if a bucket is full and local depth equals global depth?
double directory and split bucket
31
What happens if local depth is less than global depth?
split bucket only
32
What happens after splitting a bucket?
redistribute keys based on bits
33
Why is extensible hashing efficient?
can achieve about one i/o per lookup
34
What is relational algebra?
a formal query language using operations on relations
35
What is the difference between relational algebra and calculus?
algebra is operational calculus is declarative
36
What are unary operators?
operators with one input relation
37
What are binary operators?
operators with two input relations
38
What is selection σ?
filters rows based on condition
39
What is projection π?
selects specific columns
40
What is extended projection?
projection with computed attributes
41
What is union ∪?
combines tuples from two relations
42
What is intersection ∩?
tuples common to both relations
43
What is difference −?
tuples in one relation but not the other
44
What condition is required for union intersection and difference?
relations must be union compatible
45
What is Cartesian product ×?
pairs every tuple in r with every tuple in s
46
What is natural join ⋈?
join on common attributes automatically
47
What is theta join?
join based on arbitrary condition
48
What is duplicate elimination δ?
removes duplicate tuples
49
What is grouping and aggregation γ?
groups tuples and applies functions like sum count avg
50
What are common aggregation functions?
sum avg min max count
51
What is assignment operator ← used for?
store intermediate query results
Study all 51 cards for free