Some parameters of the China-domestically developed GBase 8a MPP database from GBASE can be set at session level, so they affect only the current connection. Because connection pools reuse connections, a changed value can leak into later SQL, so the safe pattern is to save the current value first, change it, then restore the saved value when done.
Saving the current value
Read the parameter with @@ and store it in a backup variable with set :
gbase> select @@estimate_func_max_len; +-------------------------+ | @@estimate_func_max_len | +-------------------------+ | 0 | +-------------------------+ 1 row in set (Elapsed: 00:00:00.00)
gbase> set @bak=@@estimate_func_max_len; Query OK, 0 rows affected (Elapsed: 00:00:00.00)
Enter fullscreen mode
Exit fullscreen mode
Changing the value
Set the new value and confirm it with show variables :
gbase> set estimate_func_max_len=32700; Query OK, 0 rows affected (Elapsed: 00:00:00.00)
gbase> show variables like 'esti%'; +-----------------------+-------+ |…