create table xyz (number UInt64) Engine=MergeTree() ORDER BY number;
Inserting 100 mln numbers from CSV.
Each 'renaming' in log = one part created on the server.
URL='http://127.0.0.1:8123/ping' | |
EXTRA='' | |
echo 'query,extra,concurrency,threads,time_started,min_req,max_req,mean_req,req_stdev,min_latency,max_latency,mean_latency,latency_stdev,50th,75th,90th,99th,99.999th,duration,requests,bytes,connect_errors,read_errors,write_errors,status_errors,timeouts' > result.csv | |
for CONCURRENCY in 1 2 4 8 16 32 64 128 256 512 768 1024 1280 1536 1792 2048 | |
do | |
if (( $CONCURRENCY < 8 )); then | |
THREADS=$CONCURRENCY |
select 'ALTER TABLE '||database||'.'||table||' DETACH PARTITION '||partition||';' from system.parts group by database,table,partition ORDER BY database, table, partition FORMAT TSVRaw; |
CREATE TABLE ascii_random_data ENGINE=TinyLog | |
AS | |
WITH | |
arrayStringConcat( | |
arrayMap( | |
x -> reinterpretAsString( toUInt8( rand(x) % 96 + 0x20 ) ), | |
range( 1024 ) | |
) | |
) as str1024, | |
substring(str1024, 1, 512 + bitAnd(rand(),0x1FF) ) as str |
#!/usr/bin/env bash | |
for db_sql_full_filename in /var/lib/clickhouse/metadata/*.sql | |
do | |
dbfilename="${db_sql_full_filename##*/}"; | |
dbname="${dbfilename%.sql}" | |
printf "\n/*************\n ** $dbname \n *************/\n" | |
perl -0777 -npe 's/^ATTACH/CREATE/; s/$/;\n/' $db_sql_full_filename; | |
printf "USE $dbname;\n\n" |
1. Download https://gallery.technet.microsoft.com/scriptcenter/Grant-Revoke-Query-user-26e259b0#content | |
2. powershell as admin | |
3. | |
Import-Module .\UserRights.psm1 | |
Grant-UserRight -Account "BUILTIN\Users" -Right SeCreateSymbolicLink | |
Get-AccountsWithUserRight -Right SeCreateSymbolicLink | |
Account Right SID | |
------- ----- --- |
@echo off | |
set VboxManageEXE="%VBOX_MSI_INSTALL_PATH%\VBoxManage.exe" | |
set ListRunningVMS=%VboxManageEXE% list runningvms | |
for /f tokens^=2^,4^ delims^=^" %%p in ('%ListRunningVMS%') do ( | |
echo "%%p" | |
%VBoxManageEXE% controlvm %%p setlinkstate1 off | |
%VBoxManageEXE% controlvm %%p setlinkstate1 on | |
) |
CREATE TABLE mat_vew_src | |
( | |
id UInt64, | |
number UInt64 | |
) | |
ENGINE = MergeTree | |
PARTITION BY tuple() | |
ORDER BY id | |
-- Ok. |
<?xml version="1.0"?> | |
<yandex> | |
<mysql_config> | |
<port>3306</port> | |
<user>user</user> | |
<password>123</password> | |
<replica> | |
<host>mysql_host</host> | |
<priority>1</priority> |
#!/usr/bin/env python | |
import csv, sys | |
csv.register_dialect('clickhouse', escapechar="\\", doublequote=0, quotechar='\'',skipinitialspace = 0,delimiter = '\t', quoting=csv.QUOTE_NONE, lineterminator='\n') | |
csv.writer(sys.stdout, dialect='clickhouse').writerows(csv.reader(sys.stdin)) | |
# install: | |
# put in $PATH | |
# chmod +x csv2tsv.py | |
# usage: |