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.
| CREATE TABLE mat_vew_src | |
| ( | |
| id UInt64, | |
| number UInt64 | |
| ) | |
| ENGINE = MergeTree | |
| PARTITION BY tuple() | |
| ORDER BY id | |
| -- Ok. |
| @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 | |
| ) |
| 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 | |
| ------- ----- --- |
| #!/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" |
| 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 |
| select 'ALTER TABLE '||database||'.'||table||' DETACH PARTITION '||partition||';' from system.parts group by database,table,partition ORDER BY database, table, partition FORMAT TSVRaw; |
| 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 |
| <yandex> | |
| <remote_servers> | |
| <test_cluster> | |
| <shard> | |
| <internal_replication>false</internal_replication> | |
| <replica> | |
| <host>ch1</host> | |
| <port>9000</port> | |
| </replica> | |
| <replica> |
| #!/bin/bash | |
| input="test.sql" | |
| curl_config="/tmp/curl_config_file.txt" | |
| echo > $curl_config | |
| while IFS= read -r line | |
| do | |
| echo "next" >> $curl_config | |
| echo "url=http://192.168.1.129:8123/?user=test&password=test&default_format=Null" >> $curl_config | |
| echo "data=\"${line}\"" >> $curl_config |