How to speed up SQL Server 2014 Spatial functions
it seems you need to add date_to column to index on date_from column (create multicolumn index on dates)
your geometry index is not used in both execution plans (probably because the boundaries in filter are outside of the boundaries in index). But it seems with correct multicolumn index you don't need this spatial index at all

Let's try this:
SELECT graveforespoergsel_id, graveperiode_fra, graveperiode_til 
INTO #t
FROM graveforespoergsel
WHERE &quot;graveperiode_til&quot; &gt;= '2019-01-10 00:00:00' AND &quot;graveperiode_fra&quot; &lt;= '2022-10-10 00:00:00'

SELECT &quot;the_geom&quot;, graveperiode_fra, graveperiode_til 
FROM #t
INNER JOIN graveforespoergsel_polygon ON graveforespoergsel_polygon.graveforespoergsel_id =  #t.graveforespoergsel_id 
WHERE &quot;the_geom&quot;.Filter(geometry::STGeomFromText('POLYGON ((434527 5928957, 434527 6282033, 1214815 6282033, 1214815 5928957, 434527 5928957))', 25832)) = 1

DROP TABLE #t