...actually, there is one part of programming which already fits that description perfectly: Tuning some badly-performing SQL.
Seriously, look at the EXPLAIN of a complicated postgres query - hash joins, index scans, bitmap heap scans, materializing intermediate tables, and so on - it does the described conversion of high-level SQL to some really complicated code, and someone with in-depth knowledge can later use the plan to tweak the database or query to improve performance.
Seriously, look at the EXPLAIN of a complicated postgres query - hash joins, index scans, bitmap heap scans, materializing intermediate tables, and so on - it does the described conversion of high-level SQL to some really complicated code, and someone with in-depth knowledge can later use the plan to tweak the database or query to improve performance.