title: setkey and the := operator, data.table, R
body: <p>When using the <code>data.table</code> package, I am a bit unsure of when i need to <code>setkey()</code>. For example, when using the <code>:=</code> operator with the <code>by</code> option, things seem to still be very fast even though I have not set a key. Could someone please elucidate when <code>setkey()</code> is necessary and when it is not? And if it is not necessary prior to calling <code>:=</code> with <code>by</code> then how is the <code>data.table</code> package so fast since presumably it has to do the same thing as <code>apply</code> in standard <code>data.frame</code> R by doing a sequential search rather than a binary one since it doesn't know whether my <code>data.table</code> is actually sorted by the argument to <code>by</code>.</p>
  
  <p>Thanks</p>