Clickhouse: AST is too big - still after set up max_ast_elements

Created on 24 Jul 2018  路  2Comments  路  Source: ClickHouse/ClickHouse

Hi
I've got very complex query. In my table is more than two million records and I want to select all rowsWHERE ( id IN (5, 4, 10, .... x)) Sometimes the tuple inside WHERE clause is very big. It can contain up to million ids. And that's the problem. I am receiving AST is too big. Maximum: 500000: (after expansion of aliases) even I set up max_ast_elements to 1 000 000. Is 500 000 max?

Do you have some suggestion how to do this query fast?

Thanks

Most helpful comment

You should set not only max_ast_elements but also max_expanded_ast_elements (this is what the (after expansion of aliases) part in the error message is hinting at).

BTW settings documentation is a bit outdated. You can look up the most up-to-date docs in the system.settings table.

All 2 comments

You should set not only max_ast_elements but also max_expanded_ast_elements (this is what the (after expansion of aliases) part in the error message is hinting at).

BTW settings documentation is a bit outdated. You can look up the most up-to-date docs in the system.settings table.

@ztlpn Thanks it helped.

Was this page helpful?
0 / 5 - 0 ratings