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
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.
Most helpful comment
You should set not only
max_ast_elementsbut alsomax_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.settingstable.