System procedures

System procedures dinther Wed, 07/22/2020 - 17:40
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.flush_log() flush the query log to disk call sys.flush_log()
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.reuse(sch string, tab string) consolidate the deletion table tab in schema sch over all columns by reusing deleted slots. No longer available since Jul2021 release. call sys.reuse('schemaX', 'tableY')
sys.shrink(sys string, tab string) consolidate the deletion table tab in schema sch over all columns by shrinking slots. No longer available since Jul2021 release. call sys.shrink('schemaX', 'tableY')
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()
sys.vacuum(sch string, tab string) vacuum table tab in schema sch No longer available since Jul2021 release. call sys.vacuum('schemaX', 'tableY')