Reduced memory usage for sparse matches