Partition constraint not used for joins involving tables partitioned by timestamp
Constraint-based exclusion [CBE] is performed on early stage of query planning, just after the query is parsed, mapped to actual relations and rewritten. (internals, Planner/Optimizer stage)

The planner cannot assume any contents of "sensor_sample" table.

So unless you have values hardcoded in the query, the planner will not exclude "partitions". 

I guess what happens with the CTE variant... the planner is restricted because you use TABLESAMPLE and the whole subquery may be treated as volatile even if literals in the subquery are static. (that's just my guess, I'm not expert on planner code)

On the bright side, the index scan with negative result is blazingly fast. (single page scan at most!) so unless you have over 10000 partitions,  I would not bother.

So, to answer your question directly:


You cannot improve this data structure much more. 
Regardin index scans - they are cheap;
Regarding sequential scans - they are avoided when possible, as you see on your own examples.