title: How to get the Count of an IObservable
body: <p>I'm lost.</p>
  
  <p>I try to get some aggregate values (mostly <code>Count</code>) from a long stream of database records. We used to used regular linq, but the volume of data has become to big to fit into the memory. I was thinking to <em>simply</em> convert the queries to IObservable to get a 'streaming' result. But I must be missing something. Most samples and documentation do not seem to account for this scenario. Perhaps Rx is not the correct toolset for this.</p>
  
  <p>So for my repro of the problem, I just generate some random data. I then group it and expect number of items in each group.</p>
  
  <pre><code>static void Main(string[] args)
  {
      // lots of DB records; from IEnumerable to IObservable
      var records= //GetRecords();
      ///*
          Observable.Interval(TimeSpan.FromMilliseconds(11))
                       .Take(100)
                       .Select(i =&gt; new { Group = DateTime.Now.Millisecond % 10 });
      //*/
      var result = from r in records
                   group r by r.Group into g
                   select new
                   {
                       Key = g.Key,
                       Count = g.Count()
                   };
  
      foreach (var item in result.ToEnumerable())
      {
          Console.WriteLine("{0} - {1}", item.Key, item.Count.Wait());
      }
  }
  </code></pre>
  
  <p>The result will only give me a value for the first item:</p>
  
  <pre><code>8 - 12
  4 - 0
  0 - 0
  5 - 0
  1 - 0
  7 - 0
  2 - 0
  3 - 0
  9 - 0
  6 - 0
  </code></pre>
  
  <p>What am I doing wrong here?</p>