Clickhouse mysql() Table function timesout

30 views Asked by At

I am migrating a few tables from MySQL to Clickhouse in batches.

while Running:
    insert into `<ch_table_name>` select * from mysql('<host>', '<db>', '<mysql_table>', '<user>', '<pass>') where column_id >= last_run and column_id < last_run + n;

there is one table that started to timeout now. Query with the same range runs fine on MySQL directly but timeouts from clickhouse with mysql() table function

-- executes in 0.2 secs in mysql to return 6 records
-- count(*) of entire table = 661M
select * from '<db>'.'<mysql_table>' where column_id >= last_run and column_id < last_run + n
-- timesout after running for 1000 secs in CH
select * from mysql('<host>', '<db>', '<mysql_table>', '<user>', '<pass>') where column_id >= last_run and column_id < last_run + n;

I could not find much documentation on how mysql() function works in clickhouse. can someone help me understand what is happening here?

0

There are 0 answers