开发者

Cost of select and aggregate function

开发者 https://www.devze.com 2023-04-03 03:17 出处:网络
I have a question for an assignment that I\'m confused about. The question is: Calucalte the lowest cost of executing query:

I have a question for an assignment that I'm confused about. The question is:

Calucalte the lowest cost of executing query:

SELECT max(profit) FROM Salesman;

What would the formula be for working this out? Would I need to use a SELECT cost formula such as Linear Search cost, or would I use an Aggregate sear开发者_StackOverflow社区ch forumla? Or the two combined?

Note: The profit field is not indexed in a B-Tree

I'm just having trouble deciding what forumla to use for this query.


I'm not sure what metrics you're using to calculate the cost. But, the question requests the "lowest" cost. So, imagine the situation that takes the least work from the system, then calculate the cost using whatever your instructor or course indicates you should use.

If your data is predetermined, couldn't you just use the chosen database system itself to describe the costs?

0

精彩评论

暂无评论...
验证码 换一张
取 消