On this page
In order to speed up the compilation of queries in SingleStoreDB Cloud,
CREATE TABLE will precompile code used to access and update table indexes.
Traditional relational database management systems interpret SQL queries the same way interpreters for languages like Python and Ruby run programs.
If you only change an integer or string constant in a query, it will not require recompilation.
SingleStoreDB Cloudstrips out numeric and string parameters from a query and attaches the resulting string to a compiled plan.
SELECT * FROM foo WHERE id=22 AND name='bar' is parameterized to
SELECT * FROM foo WHERE id=@ AND name=^.
You can list the distinct parameterized queries corresponding to all executed queries by running
The one exception to this rule is constants in the projection clause without an alias.
SELECT id + 1, id + 2 AS z FROM foo is converted to
SELECT id + 1, id + @ AS z FROM foo.
If you receive a warning
WARN: Failed to finalize asynchronous compilation, abandoning compilation of this query, this indicates a query's asynchronous compilation did not finish properly.
You can also get this warning if a table is updated, altered, or dropped within a transaction before the asynchronous compilation is finished.
Here are some solutions to consider:
max_(maximum amount of memory to compile a query) setting on the Master Aggregator.
compilation_ memory_ mb The default value for this engine variable is 4096 megabytes:SET GLOBAL max_compilation_memory_mb = 4097;
max_(maximum time compilation time) setting on the Master Aggregator.
compilation_ time_ s The default value for this engine variable is 600 seconds:SET GLOBAL max_compilation_time_s = 601;
interpreter_session variable to
compile_to interpret the query rather than compile it, and then try running the query again:
liteSET SESSION interpreter_mode = mbc;SET SESSION interpreter_mode = compile_lite;
If you continue to see this warning, it may be worthwhile to investigate why the query is taking so much memory to compile.
Last modified: April 3, 2023