Skip to main content

System procedures

Procedure Description Example
sys.analyze(minmax int, samplesize bigint) create or update sys.statistics data for all tables in all schemas. When minmax is 0 the expensive unique count operation is not performed. When samplesize is > 0 only the specified sample size number of rows are analysed.
Warning: Execution could take a long time depending on the size of your database.
call sys.analyze(0, 4000)
sys.analyze(minmax int, samplesize bigint, sch string) create or update sys.statistics data for all tables data in schema sch. When minmax is 0 the expensive unique count operation is not performed. When samplesize is > 0 only the specified sample size number of rows are analysed. call sys.analyze(1, 0, 'sys')
sys.analyze(minmax int, samplesize bigint, sch string, tbl string) create or update sys.statistics data of table tbl in schema sch. When minmax is 0 the expensive unique count operation is not performed. When samplesize is > 0 only the specified sample size number of rows are analysed. call sys.analyze(1, 0, 'sys', 'statistics')
sys.analyze(minmax int, samplesize bigint, sch string, tbl string, col string) create or update sys.statistics data of column col in table tbl in schema sch. When minmax is 0 the expensive unique count operation is not performed. When samplesize is > 0 only the specified sample size number of rows are analysed. call sys.analyze(1, 0, 'tst', 'weblog', 'url')
sys.clearrejects() clear the rejects table from possible errors encoutered from previous COPY INTO tbl FROM 'datafile.csv' ... BEST EFFORT execution call sys.clearrejects()
sys.createorderindex(schm string, tabl string, col string) create an ordered index on a specific column. The index name and location will be determined based on the schema name, table name and column name. call sys.createorderindex('schemaX', 'tableY', 'columnZ')
sys.droporderindex(schm string, tabl string, col string) remove a previously created ordered index call sys.droporderindex('schemaX', 'tableY', 'columnZ')
sys.eval(stmt string) evaluate and execute SQL statement provided as a string parameter
Note: This procedure is available since Jul2021 release and only for users with administrator privilege.
call sys.eval('SELECT pi();')
sys.hot_snapshot(tarfile string) write a snapshot (a binary copy of all data files) of the database into a (potentially very big) tar file. Optionally the tar file can be compressed by adding an extra file name suffix .lz4 or .gz or .bz2 or .xz. See HotBackup for details. call sys.hot_snapshot('/tmp/db_x_2020_06_30.tar.gz');

call sys.hot_snapshot(R'D:\Temp\voc_backup_2020_07_27.tar.gz');
sys.pause(tag bigint) pause the execution of a (long) running statement using its tag id.
run query: select * from sys.queue; to list the running statements
call sys.pause(842)
sys.querylog(filename string) use file filename to log queries call sys.querylog('/tmp/queries_log_2020_07_27.txt')
sys.resume(tag bigint) resume execution of a previouly paused statement call sys.resume(842)
sys.resume_log_flushing() resume logging queries of a previouly suspended query log call sys.resume_log_flushing()
sys.shutdown(delay tinyint) close all other client connections after delay seconds call sys.shutdown(20)
sys.shutdown(delay tinyint, force bool) close all other client connections after delay seconds, if force is set then always stop the system the hard way call sys.shutdown(20, true)
sys.stop(tag bigint) stop/abort execution of a running statement call sys.stop(842)
sys.storagemodelinit() initialize the data for the storage model call sys.storagemodelinit()
sys.suspend_log_flushing() suspend logging of queries call sys.suspend_log_flushing()