Dict/For compression

BATs can be compressed to reduce the storage footprint and, in some cases, improve performance. The compression technigues currently supported are Dictionary and Frame-of-Reference compression. The compression scheme should be manually indicated with a SQL ALTER statement.

Dict module

MODULE dict;

PATTERN dict.compress(X_0:bat[:any_1]) (X_1:bat[:any], X_2:bat[:any_1]);
COMMENT "dict compress a bat";

PATTERN dict.compress(X_0:str, X_1:str, X_2:str):void;
COMMENT "compress a sql column";

PATTERN dict.compress(X_0:str, X_1:str, X_2:str, X_3:bit):void;
COMMENT "compress a sql column";

PATTERN dict.convert(X_0:bat[:any]):bat[:any_1];
COMMENT "convert candidate list into compressed offsets";

PATTERN dict.decompress(X_0:bat[:any], X_1:bat[:any_1]):bat[:any_1];
COMMENT "decompress a dictionary compressed (sub)column";

PATTERN dict.join(X_0:bat[:any], X_1:bat[:any_1], X_2:bat[:any], X_3:bat[:any_1], X_4:bat[:oid], X_5:bat[:oid], X_6:bit, X_7:lng) (X_8:bat[:oid], X_9:bat[:oid]);
COMMENT "join 2 dictionaries";

PATTERN dict.renumber(X_0:bat[:any_1], X_1:bat[:any_1]):bat[:any_1];
COMMENT "renumber offsets";

PATTERN dict.select(X_0:bat[:any], X_1:bat[:oid], X_2:bat[:any_1], X_3:any_1, X_4:any_1, X_5:bit, X_6:bit, X_7:bit, X_8:bit):bat[:oid];
COMMENT "value - range select on a dictionary";

PATTERN dict.thetaselect(X_0:bat[:any], X_1:bat[:oid], X_2:bat[:any_1], X_3:any_1, X_4:str):bat[:oid];
COMMENT "thetaselect on a dictionary";

For module


PATTERN for.compress(X_0:str, X_1:str, X_2:str):void;
COMMENT "compress a sql column";

PATTERN for.decompress(X_0:bat[:any], X_1:any_1):bat[:any_1];
COMMENT "decompress a for compressed (sub)column";