https://www.brentozar.com/pastetheplan/?id=Bkg8vBVzb
What in the heck is this query from? I thought it may have been sp_BlitzIndex or sp_BlitzCache but I searched thru them and didn't see anything like it (looked for keywords like IgnoreDuplicateKeys or spatial_indexes). When I searched for is_hypothetical I got a hit on both sp_BlitzIndex and Ola Hallengren's IndexOptimize, but further eyeballing tells me those aren't the culprits because they're missing so many other pieces that this rogue plan has (like the spatial and xml stuff).
I noticed it because it's executed over 20k times per day and shows a lot of wait time in my monitoring tool, but then again it typically only shows waits between 1am and 7am, which is kinda around our maintenance window... I'm just really confused at this point, though, because I'm using Ola's solution for indexing and the occasional ad-hoc alter index all on some_table rebuild.
Any ideas?