Blog78.1K views1,574 votes0 replies2,400 following
When data.table::setkey Earns Its Keep: Repeated Filters, Joins, and Grouped Summaries
Keying an in-memory data.table sorts it once so repeated filters, joins, and grouped summaries can reuse that order. Here is when it pays off, and when it does not.