Question

1. Consider the relation r (Key, Name, Address). The relation takes 100 blocks on disk and...

1. Consider the relation r (Key, Name, Address). The relation takes 100 blocks on disk and holds 10000 tuples.

a. What is the selectivity of an equality predicate on Key?

b. Given a secondary IndexName (height = 3) and a range predicate on Name with selectivity of 0.02, estimate the cost of doing the lookup on A.

c. Given a clustered IndexName (height = 2) and a range predicate on Name with selectivity of 0.02, estimate the cost of doing the lookup on A.

d. Given a predicate PA with selectivity of 0.3 and a predicate PB with a selectivity of 0.5, what are the selectivities of:

(NOTE: you just need to compute the selectivity value, you do not need to estimate any costs in this part. You will have to make some assumptions about correlation between PA and PB)

  1. NOT PA
  2. PA AND PB
  3. PA OR PB
  4. PA AND (NOT PB)
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Query Processing & Optimization Task: Find an efficient physical query plan (aka execution plan) for an SQL query Goal: Minimize the evaluation time for the query, i.e., compute query result as fast as possible Cost Factors: Disk accesses, read/write operations, [I/O, page transfer] (CPU time is typically ignored) Dept. of Computer Science UC Davis 8. Query Processing and Optimization ECS-165A WQ’11 137 Basic Steps in Processing an SQL Query (System Catalogs) SQL Query Relational Algebra Expression Optimizer Statistics Query Result Evaluation Engine Execution Plan Data Files Parser & Translator • Parsing and Translating – Translate the query into its internal form (parse tree). This is then translated into an expression of the relational algebra. – Parser checks syntax, validates relations, attributes and access permissions • Evaluation – The query execution engine takes a physical query plan (aka execution plan), executes the plan, and returns the result. • Optimization: Find the “cheapest” execution plan for a query Dept. of Computer Science UC Davis 8. Query Processing and Optimization ECS-165A WQ’11 138 • A relational algebra expression may have many equivalent expressions, e.g., πCName(σPrice>5000((CUSTOMERS ✶ ORDERS) ✶ OFFERS)) πCName((CUSTOMERS ✶ ORDERS) ✶ (σPrice>5000(OFFERS)))

Add a comment
Know the answer?
Add Answer to:
1. Consider the relation r (Key, Name, Address). The relation takes 100 blocks on disk and...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Question 1 (5 marks) Consider two relations called Item and Orderltem. Imagine that relation Item has 160,000 tuples and Orderltem has 200,000 tuples. Both relations store 100 tuples per a page....

    Question 1 (5 marks) Consider two relations called Item and Orderltem. Imagine that relation Item has 160,000 tuples and Orderltem has 200,000 tuples. Both relations store 100 tuples per a page. Consider the following SQL statement SELECT * FROM Item INNER JOIN OrderItem ON Item.ItemID-OrderItem. ItemID; We wish to evaluate an equijoin between Orderltem and Item, with an equality condition Item.ltemID Orderltem.ItemID. There are 802 buffer pages available in memory for this operation. Both relations are stored as (unsorted) heap...

  • please help with no 3,4,5 and 6 Thanks 1. What is standard error? Measure of statistical...

    please help with no 3,4,5 and 6 Thanks 1. What is standard error? Measure of statistical accuracy of an estimate, equal to the standard deviation of the theorental distribution of a large populanon of such estimates 2. What calculation is used to describe the variation in measurements. 3. In experiment 3.2. You will be measuring out 40ml of volume. How many times will you measure 40 ml? 4. What is the difference for each time you measure out 40ml? In...

  • 10. The Beck & Watson article is a Group of answer choices quantitative study qualitative study...

    10. The Beck & Watson article is a Group of answer choices quantitative study qualitative study 11. Beck & Watson examined participants' experiences and perceptions using what type of research design? Group of answer choices particpant obersvation phenomenology 12. Select the participants in the Beck & Watson study Group of answer choices Caucasian women with 2-4 children Caucasian pregnant women 13. In the Beck & Watson study, data was collected via a(n) Group of answer choices internet study focus group...

  • 14. Select the number of participants in the Beck & Watson study Group of answer choices...

    14. Select the number of participants in the Beck & Watson study Group of answer choices 8 13 22 35 15. Beck & Watson determined their final sample size via Group of answer choices coding saturation triangulation ethnography 16.Through their study, Beck & Watson determined Group of answer choices after a traumatic birth, subsequent births have no troubling effects after a traumatic birth, subsequent births brought fear, terror, anxiety, and dread Subsequent Childbirth After a Previous Traumatic Birth Beck, Cheryl...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT