Files
scylladb/tests
Tomasz Grabiec fb15759934 sstables: reader: Do not read the head of the partition when index can be used
read_partition() was always called through read_next_partition(), even
if we're at the beginning of the read.  read_next_partition() is
supposed to skip to the next partition. It still works when we're
positioned before a partition, it doesn't advance the consumer, but it
clears _index_in_current_partition, because it (correctly) assumes it
corresponds to the partition we're about to leave, not the one we're
about to enter.

This means that index lookups we did in the read initializer will be
disregarded when reading starts, and we'll always start by reading
partition data from the data file. This is suboptimal for reads which
are slicing a large partition and don't need to read the front of the
partition.

Regression introduced in 4b9a34a854.

The fix is to call read_partition() directly when we're positioned at
the beginning of the partition. For that purpose a new flag was
introduced.

test_no_index_reads_when_rows_fall_into_range_boundaries has to be
relaxed, because it assumed that slicing reads will read the head of
the partition.

Refs #3984
Fixes #3992

Tested using:

 ./build/release/tests/perf/perf_fast_forward_g \
     --sstable-format=mc \
     --datasets large-part-ds1 \
     --run-tests=large-partition-slicing-clustering-keys

Before (focus on aio):

offset  read      time (s)     frags     frag/s    mad f/s    max f/s    min f/s    aio      (KiB) blocked dropped  idx hit idx miss  idx blk    c hit   c miss    c blk    cpu
4000000 1         0.001378         1        726          5        736        102      6        200       4       2        0        1        1        0        0        0  65.8%

After:

offset  read      time (s)     frags     frag/s    mad f/s    max f/s    min f/s    aio      (KiB) blocked dropped  idx hit idx miss  idx blk    c hit   c miss    c blk    cpu
4000000 1         0.001290         1        775          6        788        716      2        136       2       0        0        1        1        0        0        0  69.1%
2018-12-18 11:11:37 +01:00
..
2018-11-21 00:01:44 +02:00
2018-11-21 00:01:44 +02:00
2018-11-21 00:01:44 +02:00
2018-11-21 00:01:44 +02:00
2018-11-21 00:01:44 +02:00
2018-06-15 09:56:45 +01:00
2018-07-25 13:16:06 +02:00
2018-10-25 12:53:30 +03:00
2018-11-21 00:01:44 +02:00
2018-11-21 00:01:44 +02:00
2018-11-21 00:01:44 +02:00
2018-11-21 00:01:44 +02:00
2018-11-21 00:01:44 +02:00
2018-11-21 00:01:44 +02:00
2018-05-22 16:52:58 +02:00
2018-11-21 00:01:44 +02:00
2018-12-05 21:51:01 +02:00