What I want to know is if doing SELECT *
in a subquery gets optimized away by the database engine? Do the two code snippets below have the same performance?
SELECT A, B, C FROM (SELECT * FROM table1)
SELECT A, B, C FROM (SELECT A, B, C FROM table1)
If the answer is that it depends based on different engines, would it have the same performance for postgresql specifically?