title: OrganizationServiceContext.CreateQuery vs Fetch
body: <p>Hoping someone could shed some light from a performance standpoint on using <code>OrganizationServiceContext.CreateQuery</code> vs using <code>FetchXML</code> (or <code>QueryExpression</code>).</p>
  
  <p>I have made extensive use of <code>LINQ</code> but am new to CRM. <code>CreateQuery</code> seems like a good fit for my skill set but I wonder about performance in the end.</p>
  
  <p>I realize that straight up </p>
  
  <pre><code>var result = from e in orgContext.CreateQuery("xyz_myentity")
               where e["email"] == "someone@example.com"
               select e;
  </code></pre>
  
  <p>will return all attributes for <code>xyz_myentity</code>, but I can't seem to find any documentation for the LINQ provider that sits on top of CRM. Will the using an anonymous type limit attributes returned from SQL / CRM? Or is the magic being done "client" side after the full set of data is returned from the server? Is the SQL query for all attributes and then is the LINQ provider building the anonymous type on top of that?</p>
  
  <pre><code>var result = from e in orgContext.CreateQuery("xyz_myentity")
               where e["email"] == "someone@example.com"
               select new { Name=e["xyz_name"] };
  </code></pre>
  
  <p>Are there any other considerations related to the introduction of the <code>OrganizationServiceContext</code>?</p>