The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.
{
    'type'                   => 'Index Scan',
    'estimated_startup_cost' => 30,
    'estimated_total_cost'   => 34.33,
    'estimated_rows'         => 1,
    'estimated_row_width'    => 40,
    'extra_info'             => [
        'Index Cond: (e.id_contact_event = CASE WHEN (("outer".client_status_cc = 2) AND ("outer".client_status_unit = 2) AND ("outer".id_employee_responsible IS NULL) AND ("outer".id_unit_responsible IS NULL)) THEN (subplan) ELSE "outer".latest_event END)',
    ],
    'actual_time_first'      => 0.003,
    'actual_time_last'       => 0.003,
    'actual_rows'            => 1,
    'actual_loops'           => 19499,
    'is_analyzed'            => 1,
    'scan_on'                => {
        'table_name'  => 'of_contact_event',
        'index_name'  => 'id_contact_event_idx',
        'table_alias' => 'e',
    },
    'subplans' => [
        {
            'type'                   => 'Limit',
            'estimated_startup_cost' => 29.99,
            'estimated_total_cost'   => 30,
            'estimated_rows'         => 1,
            'estimated_row_width'    => 19,
            'actual_time_first'      => 0.018,
            'actual_time_last'       => 0.018,
            'actual_rows'            => 1,
            'actual_loops'           => 5570,
            'is_analyzed'            => 1,
            'sub_nodes' => [
                {
                    'type'                   => 'Sort',
                    'estimated_startup_cost' => 29.99,
                    'estimated_total_cost'   => 30,
                    'estimated_rows'         => 4,
                    'estimated_row_width'    => 19,
                    'actual_time_first'      => 0.018,
                    'actual_time_last'       => 0.018,
                    'actual_rows'            => 1,
                    'actual_loops'           => 5570,
                    'is_analyzed'            => 1,
                    'extra_info' => [ 'Sort Key: status, date_registration, visit', ],
                    'sub_nodes' => [
                        {
                            'type'                   => 'Index Scan',
                            'estimated_startup_cost' => 0,
                            'estimated_total_cost'   => 29.95,
                            'estimated_rows'         => 4,
                            'estimated_row_width'    => 19,
                            'extra_info'             => [
                                'Index Cond: (id_contact_client = $0)', 'Filter: (id_contact_event < $1)',
                            ],
                            'actual_time_first'      => 0.006,
                            'actual_time_last'       => 0.012,
                            'actual_rows'            => 6,
                            'actual_loops'           => 5570,
                            'is_analyzed'            => 1,
                            'scan_on'                => {
                                'table_name'  => 'of_contact_event',
                                'index_name'  => 'idx_of_contact_event_id_contact_client',
                                'table_alias' => 'ev2',
                            },
                        },
                    ],
                }
            ],
        },
        {
            'type'                   => 'Limit',
            'estimated_startup_cost' => 29.99,
            'estimated_total_cost'   => 30,
            'estimated_rows'         => 1,
            'estimated_row_width'    => 19,
            'actual_loops'           => 0,
            'is_analyzed'            => 1,
            'sub_nodes' => [
                {
                    'type'                   => 'Sort',
                    'estimated_startup_cost' => 29.99,
                    'estimated_total_cost'   => 30,
                    'estimated_rows'         => 4,
                    'estimated_row_width'    => 19,
                    'actual_loops'           => 0,
                    'is_analyzed'            => 1,
                    'extra_info' => [ 'Sort Key: status, date_registration, visit', ],
                    'sub_nodes' => [
                        {
                            'type'                   => 'Index Scan',
                            'estimated_startup_cost' => 0,
                            'estimated_total_cost'   => 29.95,
                            'estimated_rows'         => 4,
                            'estimated_row_width'    => 19,
                            'extra_info'             => [
                                'Index Cond: (id_contact_client = $0)', 'Filter: (id_contact_event < $1)',
                            ],
                            'actual_loops'           => 0,
                            'is_analyzed'            => 1,
                            'scan_on'                => {
                                'table_name'  => 'of_contact_event',
                                'index_name'  => 'idx_of_contact_event_id_contact_client',
                                'table_alias' => 'ev2',
                            },
                        },
                    ],
                }
            ],
        },
    ]
}