Skip to main content


A performance trace can be obtained using the TRACE statement modifier. It collects all the trace information in a table reproduced by tracelog(), which can be queried using ordinary SQL statements. The internal trace table is reset at each query being traced. Its definition is given below:

create function sys.tracelog()
    returns table (
        event integer,      -- event counter
        clk varchar(20),    -- wallclock, no mtime in kernel
        pc varchar(50),     -- module.function[nr]
        thread int,         -- thread identifier
        ticks bigint,       -- time in microseconds
        rrsMB bigint,       -- resident memory in MB
        vmMB bigint,        -- virtual size in MB
        reads bigint,       -- number of blocks read
        writes bigint,      -- number of blocks written
        minflt bigint,      -- minor page faults
        majflt bigint,      -- major page faults
        nvcsw bigint,       -- non-volantary conext switch
        stmt string         -- actual statement executed
    external name sql.dump_trace;