ARROW-10569: [C++] Improve table filtering performance
ARROW-10569: [C++] Improve table filtering performance

Instead of applying the same boolean filter to all N columns, first convert the filter to take indices.
Selecting indices of a linear array is much faster, thanks to avoiding bit-unpacking on the boolean filter.

Using the Python benchmark setup from ARROW-10569:
```python
import pandas as pd
import pyarrow as pa
import pyarrow.compute as pc
import numpy as np

num_rows = 10_000_000
data = np.random.randn(num_rows)

df = pd.DataFrame({'data{}'.format(i): data
                   for i in range(100)})

df['key'] = np.random.randint(0, 100, size=num_rows)

rb = pa.record_batch(df)
t = pa.table(df)
```

* before:
```python
>>> %timeit rb.filter(pc.equal(rb[-1], 5))
60 ms ± 509 µs per loop (mean ± std. dev. of 7 runs, 10 loops each)
>>> %timeit t.filter(pc.equal(t[-1], 5))
1.22 s ± 2.42 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)
```
* after:
```python
>>> %timeit rb.filter(pc.equal(rb[-1], 5))
59.2 ms ± 583 µs per loop (mean ± std. dev. of 7 runs, 10 loops each)
>>> %timeit t.filter(pc.equal(t[-1], 5))
59.3 ms ± 339 µs per loop (mean ± std. dev. of 7 runs, 10 loops each)
```

Closes #8777 from pitrou/ARROW-10569-table-filter-perf

Authored-by: Antoine Pitrou <9359a4d812173b65a3a0094cd86363e79731a3c2@python.org>
Signed-off-by: Antoine Pitrou <9359a4d812173b65a3a0094cd86363e79731a3c2@python.org>

apache/arrow,icexelloss/arrow,apache/arrow,laurentgo/arrow,icexelloss/arrow,wesm/arrow,laurentgo/arrow,apache/arrow,apache/arrow,icexelloss/arrow,laurentgo/arrow,cpcloud/arrow,kou/arrow,cpcloud/arrow,icexelloss/arrow,apache/arrow,laurentgo/arrow,laurentgo/arrow,laurentgo/arrow,apache/arrow,laurentgo/arrow,kou/arrow,wesm/arrow,icexelloss/arrow,apache/arrow,wesm/arrow,wesm/arrow,icexelloss/arrow,apache/arrow,laurentgo/arrow,wesm/arrow,wesm/arrow,cpcloud/arrow,icexelloss/arrow,cpcloud/arrow,wesm/arrow,laurentgo/arrow,laurentgo/arrow,laurentgo/arrow,cpcloud/arrow,cpcloud/arrow,cpcloud/arrow,kou/arrow,apache/arrow,icexelloss/arrow,laurentgo/arrow,cpcloud/arrow,kou/arrow,icexelloss/arrow,icexelloss/arrow,kou/arrow,wesm/arrow,wesm/arrow,cpcloud/arrow,apache/arrow,laurentgo/arrow,apache/arrow,cpcloud/arrow,laurentgo/arrow,kou/arrow,kou/arrow,kou/arrow,cpcloud/arrow,cpcloud/arrow,wesm/arrow,wesm/arrow,cpcloud/arrow,laurentgo/arrow,apache/arrow,kou/arrow,icexelloss/arrow,wesm/arrow,apache/arrow,kou/arrow,icexelloss/arrow,kou/arrow,icexelloss/arrow,apache/arrow,wesm/arrow,icexelloss/arrow,kou/arrow,cpcloud/arrow,kou/arrow,wesm/arrow,kou/arrow