How to determine if a timestamp in one table is between two timestamps in a subquery of another table?
You can do this with one EXISTS subquery:

UPDATE "index" AS i 
SET pln = TRUE
WHERE EXISTS 
      ( SELECT *
        FROM planning AS p
        WHERE p.state = 'selected' 
          AND p.macro NOT LIKE 'mae%'
          AND p.start_time &lt;= i.datetime 
          AND i.datetime &lt; p.end_time 
      ) ;


I changed the BETWEEN to &gt;= start_time and &lt; end_time, as it is more common (and more sensible) to have inclusive-exclusive datetime ranges. You can change it back to &gt;= and &lt;= or to (the equivalent) BETWEEN.