ClickHouse/tests/queries/0_stateless/01817_storage_buffer_parameters.sql
Azat Khuzhin 19e0439629 Add ability to flush buffer only in background for StorageBuffer
Add 3 new engine arguments:
- flush_time
- flush_rows
- flush_bytes

That will be checked only for background flush, this maybe useful if
INSERT latency is "crucial".
2021-04-15 21:22:13 +03:00

43 lines
1.5 KiB
SQL

drop table if exists data_01817;
drop table if exists buffer_01817;
create table data_01817 (key Int) Engine=Null();
-- w/ flush_*
create table buffer_01817 (key Int) Engine=Buffer(currentDatabase(), data_01817,
/* num_layers= */ 1,
/* min_time= */ 1, /* max_time= */ 86400,
/* min_rows= */ 1e9, /* max_rows= */ 1e6,
/* min_bytes= */ 0, /* max_bytes= */ 4e6,
/* flush_time= */ 86400, /* flush_rows= */ 10, /* flush_bytes= */0
);
drop table buffer_01817;
-- w/o flush_*
create table buffer_01817 (key Int) Engine=Buffer(currentDatabase(), data_01817,
/* num_layers= */ 1,
/* min_time= */ 1, /* max_time= */ 86400,
/* min_rows= */ 1e9, /* max_rows= */ 1e6,
/* min_bytes= */ 0, /* max_bytes= */ 4e6
);
drop table buffer_01817;
-- not enough args
create table buffer_01817 (key Int) Engine=Buffer(currentDatabase(), data_01817,
/* num_layers= */ 1,
/* min_time= */ 1, /* max_time= */ 86400,
/* min_rows= */ 1e9, /* max_rows= */ 1e6,
/* min_bytes= */ 0 /* max_bytes= 4e6 */
); -- { serverError 42 }
-- too much args
create table buffer_01817 (key Int) Engine=Buffer(currentDatabase(), data_01817,
/* num_layers= */ 1,
/* min_time= */ 1, /* max_time= */ 86400,
/* min_rows= */ 1e9, /* max_rows= */ 1e6,
/* min_bytes= */ 0, /* max_bytes= */ 4e6,
/* flush_time= */ 86400, /* flush_rows= */ 10, /* flush_bytes= */0,
0
); -- { serverError 42 }
drop table data_01817;