{ "@context": "https://schema.org", "@type": "Organization", "name": "Brainscape", "url": "https://www.brainscape.com/", "logo": "https://www.brainscape.com/pks/images/cms/public-views/shared/Brainscape-logo-c4e172b280b4616f7fda.svg", "sameAs": [ "https://www.facebook.com/Brainscape", "https://x.com/brainscape", "https://www.linkedin.com/company/brainscape", "https://www.instagram.com/brainscape/", "https://www.tiktok.com/@brainscapeu", "https://www.pinterest.com/brainscape/", "https://www.youtube.com/@BrainscapeNY" ], "contactPoint": { "@type": "ContactPoint", "telephone": "(929) 334-4005", "contactType": "customer service", "availableLanguage": ["English"] }, "founder": { "@type": "Person", "name": "Andrew Cohen" }, "description": "Brainscape’s spaced repetition system is proven to DOUBLE learning results! Find, make, and study flashcards online or in our mobile app. Serious learners only.", "address": { "@type": "PostalAddress", "streetAddress": "159 W 25th St, Ste 517", "addressLocality": "New York", "addressRegion": "NY", "postalCode": "10001", "addressCountry": "USA" } }

Lecture 3 Flashcards

(12 cards)

1
Q

What is an index? Index entry?

A

Index: A data structure that organizes records on disk for quick access
Index entry: A pair of search key, and record address

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Explain Hash based indexing

A

We have a hash function, H, our queries hit that hash function to determine the right bucket in the index file. The bucket stores a collection of pages, so we search bucket to find the right record.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

In a tree based index structure, where is the data stored? Index values?

A

Data: Leaf nodes
Index: Internal nodes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Explain the difference between a clustered and unclustered index

A

Clustered is when the order of the index file is near identical to the order of the records

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Explain the difference between a dense and sparse index

A

Dense: At least 1 index for every search key
Sparse: Search keys may not have a index.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Explain the difference between a primary index and a secondary index

A

Primary: index on the primary, unique key.
Secondary: Indexes on other columns, possible to have multiple indexes for the same search key.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Does ISAM use overflow pages or does it use node splitting?

A

Overflow pages.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

In B+ trees, what do internal nodes store? Leaf nodes?

A

Internal: Index entries/Search keys
Leaf: Data entries

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is the only scenario where redistribution in B+ tree insert is useful?

A

When it delays/postpones/prevents a split.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

When redistribution, what key value takes the position of the parent node?

A

The smallest key value in the second node

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Does a larger height of a B+ tree increase or decrease the operational speed of the tree?

A

Decrease

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is fanout and how do we increase it?

A

Fanout is when we make the tree more “wide”
To increase fanout we can: increase page size, decrease size of index entry (key compression)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly