title: How to Pre Stage Queries on SQL Server?
body: <p>I've looked for tips of how to speed up sql intensive application and found <a href="http://www.infoworld.com/article/2628420/database/database-7-performance-tips-for-faster-sql-queries.html" rel="nofollow">this particularly useful link</a>.</p>
  
  <p>In point 6 he says </p>
  
  <blockquote>
    <ol start="6">
    <li>Do pre-stage data This is one of my favorite topics because it's an old technique that's often overlooked. If you have a report or a
    procedure (or better yet, a set of them) that will do similar joins to
    large tables, it can be a benefit for you to pre-stage the data by
    joining the tables ahead of time and persisting them into a table. Now
    the reports can run against that pre-staged table and avoid the large
    join.</li>
    </ol>
    
    <p>You're not always able to use this technique, but when you can, you'll
    find it is an excellent way to save server resources.</p>
    
    <p>Note that many developers get around this join problem by
    concentrating on the query itself and creating a view-only around the
    join so that they don't have to type the join conditions again and
    again. But the problem with this approach is that the query still runs
    for every report that needs it. By pre-staging the data, you run the
    join just once (say, 10 minutes before the reports) and everyone else
    avoids the big join. I can't tell you how much I love this technique;
    in most environments, there are popular tables that get joined all the
    time, so there's no reason why they can't be pre-staged</p>
  </blockquote>
  
  <p>From what I understood you join the tables once and several SQL Queries can "benefit" from it. That looks extremely interesting for the application I'm working at.</p>
  
  <p>The thing is, I've been looking for <code>pre staging data</code> around and couldn't find anything that seems to be related to that technique. Maybe I'm missing a few keywords ?</p>
  
  <p>I'd like to know how to use the described technique within SQL Server. The link says it's an old technique so it shouldn't be a problem that I'm using SQL Server 2008.</p>
  
  <p>What I would like is the following: I have several <code>SELECT</code> queries that run in a row. All of them join the same 7-8 tables and they're all really heavy, that impacts performance. So I'm thinking of joining them, run the queries and them drop this intermediate table. How/Can it be done ?</p>