For effective optimization, it would be nice to be able to look at the top costs by various categories such as services, descriptions and tags.
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;
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;
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;
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;