Cost Research

To optimize efficiency, it would be great if we could look at top costs by various categories like services, description and tags.

  1. Display Top 10 Account IDs that cost the most
SELECT "line_item_usage_account_id",
	round(sum("line_item_unblended_cost"), 2) as cost
FROM "costmaster"."monthly_report"
GROUP BY "line_item_usage_account_id"
ORDER BY cost desc
LIMIT 10;

Cost

  1. Query returned results

Cost

  1. Display Top 10 Services that cost the most
SELECT "line_item_product_code",
	round(sum("line_item_unblended_cost"), 2) as cost
FROM "costmaster"."monthly_report"
GROUP BY "line_item_product_code"
ORDER BY cost desc
LIMIT 10;

Cost

  1. Query returned results

Cost

  1. Display Top 10 Services and Detailed Descriptions with the most expensive cost
SELECT "line_item_product_code",
	"line_item_line_item_description",
	round(sum("line_item_unblended_cost"), 2) as cost
FROM "costmaster"."monthly_report"
WHERE "line_item_product_code" like '%AmazonEC2%'
GROUP BY "line_item_product_code",
	"line_item_line_item_description"
ORDER BY cost desc
LIMIT 10;

Cost

  1. Query returned results

Cost

  1. Display Top 10 usage situations of On Demand EC2 type that cost the most
SELECT "line_item_product_code",
	"line_item_line_item_description",
	round(sum("line_item_unblended_cost"), 2) as cost
FROM "costmaster"."monthly_report"
WHERE "line_item_product_code" like '%AmazonEC2%'
	and "line_item_usage_type" like '%BoxUsage%'
GROUP BY "line_item_product_code",
	"line_item_line_item_description"
ORDER BY cost desc
LIMIT 10;

Cost

  1. Query returned results

Cost