title: What is the bottle neck in using a DBContext?
body: <p>In the following code snippet, which ever List I load first takes about 3000 milliseconds more than the others.
  This causes me to think that something is happening on the first .ToList() that it isn't happening on later .ToList() calls.  What could it be?   </p>
  
  <p>I am hoping there is something I can tweek to increase performance.  </p>
  
  <p>db is my DBContext instance.</p>
  
  <blockquote>
    <p>using (var db = new MyDataEntities())              </p>
    
    <p>{</p>
  
  <pre><code>            const int linkTypeId = 3;
  
              var sw = new Stopwatch();
              sw.Start();
  
  
              // section A
              sw.Restart();
              var qry2 = from p in db.ViewPropertyPairs where p.LinkID == JobId &amp;&amp; p.LinkType == linkTypeId select p;
              this.ViewPropertyPairs = qry2.ToList();
              sw.Stop();
              Debug.Print(string.Format("{0}  ms for to view property pair list", sw.ElapsedMilliseconds));
  
              // Section B
  
              sw.Restart();
              this.PropertyNames = db.PropertyNames.ToList();
              sw.Stop();
              Debug.Print(string.Format("{0}  ms for propertynames",  sw.ElapsedMilliseconds));
  
  
              // Section C
              sw.Restart();
              var qry =from p in db.PropertyPairs where p.LinkID == JobId &amp;&amp; p.LinkType == linkTypeId select p ;
              this.PropertyPairs = qry.ToList();
              sw.Stop();
              Debug.Print(string.Format("{0}  ms for to property pair list", sw.ElapsedMilliseconds));
  
  
          }
  </code></pre>
  </blockquote>