Commit Graph

16 Commits

Author SHA1 Message Date
Duarte Nunes
e33c02aa60 cql3: Disable compression on empty properties
The CQL 3.1 documentation specifies that for disabling compression,
users should use an empty string:

ALTER TABLE mytable WITH COMPRESSION = {'sstable_compression': ''};

However, Cassandra also accepts the absence of the sstable_compression
option to disable compression. The patch 7c28ed prevented this behavior
in Scylla, which this patch aims to fix.

Signed-off-by: Duarte Nunes <duarte@scylladb.com>
Message-Id: <1478639499-4183-1-git-send-email-duarte@scylladb.com>
2016-11-09 10:03:59 +02:00
Duarte Nunes
7c28ed3dfc schema: Extract default compressor
This patch extracts the definition of the default compressor into the
compression_parameters class, so that the table and view creation
statements don't have to explicitly deal with it.

Signed-off-by: Duarte Nunes <duarte@scylladb.com>
2016-10-18 01:18:52 +00:00
Nadav Har'El
164c760324 Switch compression chunk default from 64 KB to 4 KB
Following Cassandra, our default sstable compression chunk size is 64 KB.
The big downside of this default size is that small reads need to read
and uncompress a large chunk, around 32 KB (if compression halves the data
size). In this patch we switch the default chunk size to 4 KB, which allows
faster small reads (the report in issue #1337 was of a 60-fold speedup...).

Since commit 2f56577, large reads will not be signficantly slowed down by
changing to a small chunk size. The remaining potential downside of this
change is lowering of the compression ratio because of the smaller chunks
individually compressed. However, experimentation shows that the compression
ratio is hurt somewhat, but not dramatically, by lowering the chunk size:
A recent survey of Cassandra compression in
https://www.percona.com/blog/2016/03/09/evaluating-database-compression-methods/
reports a compression ratio of 2 for 64 KB chunks, vs. 1.75 for 4 KB chunks.
My own test on a cassandra-stress workload (whose data is relatively hard
to compress), showed compression ratio 1.25 for 64 KB chunk, vs. 1.23 for
4 KB chunks.

Also remember that if a user wants to control the chunk length for a
particular table, he can - the 64 KB or 4 KB sizes are just the default.

Fixes #1337

Signed-off-by: Nadav Har'El <nyh@scylladb.com>
Message-Id: <1467063335-12096-1-git-send-email-nyh@scylladb.com>
2016-06-28 08:50:24 +03:00
Pekka Enberg
38a54df863 Fix pre-ScyllaDB copyright statements
People keep tripping over the old copyrights and copy-pasting them to
new files. Search and replace "Cloudius Systems" with "ScyllaDB".

Message-Id: <1460013664-25966-1-git-send-email-penberg@scylladb.com>
2016-04-08 08:12:47 +03:00
Tomasz Grabiec
f9d6c7b026 compress: Add equality operators 2015-12-16 18:06:55 +01:00
Avi Kivity
d5cf0fb2b1 Add license notices 2015-09-20 10:43:39 +03:00
Paweł Dziepak
148d6b9db2 compress: allow empty sstable_compression
Fixes #13.

Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-07-08 10:47:11 +02:00
Paweł Dziepak
a0424d5d27 compressor: allow an empty map of options
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-06-29 09:36:14 +02:00
Paweł Dziepak
b520ef6172 compress: generate a std::map<sstring, sstring> of options
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-06-29 09:35:01 +02:00
Paweł Dziepak
f4ce125422 compress: use std::optional for chunk length and crc check chance
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-06-29 09:30:31 +02:00
Paweł Dziepak
9134381638 compress: accept both qualified and unqualified class names
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-06-29 09:05:50 +02:00
Paweł Dziepak
c51a430020 compress: "DeflateCompressor" is not compressor::none
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-06-29 08:25:13 +02:00
Paweł Dziepak
4899100877 compress: use '= default' for default constructor
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-06-25 16:32:58 +02:00
Paweł Dziepak
28242489c3 compress: fix include quotes
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-06-25 16:32:30 +02:00
Paweł Dziepak
53640c73fd compress: add compression_parameters class
Passing a single enum specifying a compressor type around is not enough,
since there are other compression options user may want to specify.

Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-06-25 13:32:13 +02:00
Raphael S. Carvalho
d1ed0744f0 schema: add sstable compressor property
The field compressor is about saying which compressor algorithm
must be used in compression of sstable data file.
This is a small step towards compressed sstable data file.

Signed-off-by: Raphael S. Carvalho <raphaelsc@cloudius-systems.com>
2015-06-09 11:18:56 +03:00