title: Very Slow VARBINARY(MAX) Select
body: <p>I store small (between 20K and 2MB) files in a <code>VARBINARY(MAX)</code> column. On my dev environment, which is local (on my development PC), the selection takes 20ms. </p>
  
  <pre><code>UPDATE [DB_9FB6F6_smartplates].[dbo].[ImageLibrary]
  SET filetype = 'jpg' 
  WHERE filetype = 'exiting'
  
  SELECT BinaryData 
  FROM [ImageLibrary] 
  WHERE Id = 1056
  </code></pre>
  
  <p>(Where <code>Id</code> is the primary key)</p>
  
  <p>I upload my code to my (cheapish) hosting company, and execute the same query, it it takes 13 seconds.</p>
  
  <p>We're both running SQL Server 2016. They just provide a database with no real access rights (no <code>sa</code> or anything like that), so I don't have permission to profile, but the code does seem to stick at that select.</p>
  
  <p>Is there anyway I can find out why the same query takes so long on their environment, and mine is quick? Note, the DB is backed up from their environment and restored onto mine... So it's the exact same database.</p>
  
  <p>All other queries are quick. It's just this selection on a <code>VARCHAR(MAX)</code> that is slow. I'm not sure how to diagnose it, and then query their support.</p>