On Fri, Dec 8, 2017 at 3:05 AM, Eunsu Kim <eunsu.bil...@gmail.com> wrote:

> There is a table with a timestamp as a cluster key and sorted by ASC for
> the column.
>
> Is it better to insert by the time order when inserting data into this
> table for insertion performance? Or does it matter?
>

The writes hit memory tables first, so from this perspective it shouldn't
matter.

Later the memory tables are sorted according to the partition and
clustering key and are flushed to disk in this order, forming the SSTable
files.  The difference in performance you might experience upon reading the
data, depending on compaction strategy you choose.  For time-series data
with TTL there is good chance that TimeWindowCompactionStrategy is
appropriate, given you mostly write with approx. monotonically increasing
timestamps.  This helps organizing the data files for faster reads and
really cheap removal of expired data: the whole file can be just dropped by
compaction process once all records in it expire.

Regards,
-- 
Oleksandr "Alex" Shulgin | Database Engineer | Zalando SE | Tel: +49 176
127-59-707

Reply via email to