title: LINQ Select First
body: <p>Hi I have this bit of linq code</p>
  
  <pre><code>var fp = lnq.attaches.First(a =&gt; a.sysid == sysid).name;
  </code></pre>
  
  <p>When profiled it generates the following t-sql</p>
  
  <pre><code>SELECT TOP (1) [t0].[sysid], [t0].[name], [t0].[att_size], [t0].[cid], [t0].[flags], [t0].[contents] 
  FROM [lntmuser].[attach] AS [t0]
  </code></pre>
  
  <p>The way I look at it, it is returning like a select *, which will cause the query to perform a table scan rather then use an index.  Bad for performance.</p>
  
  <p>How could I select just the name column, like:</p>
  
  <pre><code>SELECT TOP (1)[t0].[name] FROM [lntmuser].[attach] AS [t0]
  </code></pre>
  
  <p>Thanks in advance</p>
  
  <hr>
  
  <p>Edit:
  Broken Glasses Solution profiles as desired </p>
  
  <pre><code>SELECT TOP (1) [t0].[name]
  FROM [lntmuser].[attach] AS [t0]
  WHERE [t0].[sysid] = @p0
  </code></pre>