Questions should not use headings, because they should not be long enough for headings to be useful. In particular, you should take care not to conflate a debugging question with a how-to question. If you want to know how to do something, then we don't need a MRE of failed attempts or solutions to simpler problems etc. We need, instead, a clear specification of what the code should do.
In your case, for example, instead of showing dozens of lines of "setup" SQL, just show a table (using table markup) with example data that is minimally complex for a demonstration of what the code needs to do, and then another table showing the exact desired corresponding output. Use brief prose in between to explain what each table represents.
Please consider for a moment what your question looks like if we take out the tables and code:
Problem Description I have a table (#tmstmp) with 2 columns dt (DATETIME) and payload (INT). Eventually I want to sum payload for each 5 minute interval there is. Code Setup Non overlapping timeslots are easy Ultimate Goal: get running timeslots I want, however, to have an entry for each interval in the range, that is from 12:00-12:05, 12:01-12:06, 12:02-12:07 etc. until the last timeslot. I can construct the limits in the whole range before and use that in a JOIN like this: While this works in this toy example I have hundreds of thousands of timestamps in my real data and worst of all I little impact on the indices. My gut feeling tells me that I will create quite some duplication with my inequality JOIN and I was wondering whether this is anyways the canonical way of doing it or whether there is a more SQL-onic way of doing it? (like the pythonistas like to call certain code pythonic if it uses the language inherent concepts rather than trying to solve it with general tools).
That is 9 lines (in the sense of being newline-delimited), of which 5 are headings. Three of those headings don't even have any prose underneath them. That's... really excessive.
Further, the outline doesn't help understand the problem. Saying that the goal is to get running timeslots would be better accomplished, for example, by just saying that in the prose. (Incidentally, I don't think you mean running timeslots, but rather overlapping timeslots - you want to collect results from a "sliding window" or "rolling window" of timestamps.)
And then, the code shown here doesn't really help explain the problem. If you really need the question to be specific to this exact schema - rather than it just being one minimal, example schema that is useful for demonstrating the tool or technique you're asking about - then you're not asking a question suitable for Stack Overflow; you're asking someone to write code for you. On the other hand, showing that you can solve a simpler problem doesn't really help explain how the more complex problem differs; and this is already evident from a proper specification. Showing your attempt at the more complex problem is only relevant if you are specifically asking about optimizing that approach, rather than accepting any new approaches (and in this case the question almost certainly Needs More Focus, as you have neither verified that there is a performance issue nor attempted to isolate an underlying cause.)
Making the important parts of the prose stand out, or highlighting the structure, is better accomplished by not having as much stuff in between to space it out. (And yes, the fact that I begin and end this answer with a short bit of bold text, is very much intentional. You are meant to reflect on this like a Zen koan.)