• Varun Gupta's avatar
    MDEV-6111 Optimizer Trace · be8709eb
    Varun Gupta authored
    This task involves the implementation for the optimizer trace.
    
    This feature produces a trace for any SELECT/UPDATE/DELETE/,
    which contains information about decisions taken by the optimizer during
    the optimization phase (choice of table access method, various costs,
    transformations, etc). This feature would help to tell why some decisions were
    taken by the optimizer and why some were rejected.
    
    Trace is session-local, controlled by the @@optimizer_trace variable.
    To enable optimizer trace we need to write:
       set @@optimizer_trace variable= 'enabled=on';
    
    To display the trace one can run:
       SELECT trace FROM INFORMATION_SCHEMA.OPTIMIZER_TRACE;
    
    This task also involves:
        MDEV-18489: Limit the memory used by the optimizer trace
        introduces a switch optimizer_trace_max_mem_size which limits
        the memory used by the optimizer trace. This was implemented by
        Sergei Petrunia.
    be8709eb
sysvars_server_embedded.result 149 KB