Để tối ưu hóa được hiệu quả, sẽ rất tốt nếu ta có thể xem xét những chi phí hàng đầu theo nhiều danh mục khác nhau như dịch vụ, mô tả và tag.
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;