',
- ].join(''));
- };
-
- var _renderExplainTable = (_data, $_container) => {
- var $explainTableData = $('
');
- _.each(_data.rows, (_row) => {
- var $tblRow = $(_row);
- $tblRow.appendTo($explainTableData);
- });
- $explainTableData.appendTo($_container);
-
- if (_data.show_timings === true) {
- $_container.find('.timings').removeClass('d-none');
- }
-
- if (_data.show_rowsx === true) {
- $_container.find('.rowsx').removeClass('d-none');
- } else if (_data.show_rows === true) {
- $_container.find('.rows').removeClass('d-none');
- $_container.find('thead .rows[colspan=3]').attr('colspan', 1);
- } else if (_data.show_plan_rows === true) {
- $_container.find('.plan_rows').removeClass('d-none');
- $_container.find('thead .rows[colspan=3]').attr('colspan', 1);
- }
- };
-
- var _createStatisticsTables = () => {
- return $([
- '
',
- ].join(''));
-
- var _renderStatisticsTable = (_data, $_container) => {
- var $perTableTbl = $_container.find('table[for="per_table"]'),
- $perNodeTbl = $_container.find('table[for="per_node_type"]');
-
- _.each(
- _.sortBy(_.values(_data.statistics.nodes), 'name'),
- (_node) => (
- $perNodeTbl.append(_statisticRowTemplate({
- 'data': _node, 'total_time': _data.total_time,
- 'className': '',
- }))
- )
- );
-
- _.each(
- _.sortBy(_.values(_data.statistics.tables), 'name'),
- (_table) => {
- _table.sum_of_times = 0;
- _.each(_table.nodes, (_node) => (
- _table.sum_of_times += _node.sum_of_times
- ));
- $perTableTbl.append(_statisticRowTemplate({
- 'data': _table, 'total_time': _data.total_time,
- 'className': 'table',
- }));
-
- _.each(
- _.sortBy(_.values(_table.nodes), 'name'),
- (_node) => {
- $perTableTbl.append(_statisticRowTemplate({
- 'data': _node, 'total_time': _table.sum_of_times,
- 'className': 'node',
- }));
- }
- );
- }
- );
-
- if (_data.show_timings) {
- $_container.find('.timings').removeClass('d-none');
- }
- };
-
- var _explainRowTemplate = _.template([
- '
0) {%>',
- ' pga-ex-collapsible',
- '<%}%>',
- '<% if (data["exclusive_flag"] !== "undefined") {%>',
- ' pga-ex-exclusive-', '<%- data["exclusive_flag"] %>',
- '<%}%>',
- '<% if (data["inclusive_flag"] !== "undefined") {%>',
- ' pga-ex-inclusive-', '<%- data["inclusive_flag"] %>',
- '<%}%>',
- '<% if (data["rowsx_flag"] !== "undefined") {%>',
- ' pga-ex-rowsx-', '<%- data["rowsx_flag"] %>',
- '<%}%>',
- '"',
- '<% if (data["parent_node"]) {%>',
- ' data-parent="pga_ex_<%= data["parent_node"] %>"',
- '<%}%>',
- ' data-ex-id="pga_ex_<%= data["level"].join("_") %>">',
- ' | ',
- ' ',
- ' | ',
- ' ',
- '<%= (data["_serial"]) %>. | ',
- ' px"',
- 'title="<%= tooltip_text %>"',
- '>',
- ' ',
- '<%= display_text %>',
- '<%if (node_extra_info && node_extra_info.length > 0 ) {%>',
- '',
- '<% for (var node_info_idx=0; ',
- ' node_info_idx',
- ' ', '<%= node_extra_info[node_info_idx] %>', '',
- '<% }%>',
- '',
- '<%}%>',
- ' | ',
- ' ',
- 'pga-ex-exclusive-', '<%- data["exclusive_flag"] %>',
- '<%}%>',
- '">',
- '<% if (typeof(data["exclusive"]) !== "undefined") {%>', '<%= data["exclusive"] %> ms', '<%}%>',
- ' | ',
- ' ',
- 'pga-ex-inclusive-', '<%- data["inclusive_flag"] %>',
- '<%}%>',
- '">',
- '<% if (typeof(data["inclusive"]) !== "undefined") {%>', '<%= data["inclusive"] %> ms', '<%}%>',
- ' | ',
- ' ',
- 'pga-ex-rowsx-', '<%- data["rowsx_flag"] %>',
- '<%}%>',
- '">',
- '<% if (data["rowsx_direction"] === "positive") {%>',
- '↑',
- '<%} else {%>',
- '↓',
- '<%}%> ',
- '<% if (typeof(data["rowsx"]) !== "undefined") {%>',
- '<%- data["rowsx"] %>',
- '<%}%> ',
- ' | ',
- ' ',
- '<% if (typeof(data["Actual Rows"]) !== "undefined") {%>',
- '<%= data["Actual Rows"] %>',
- '<%}%>',
- ' | ',
- ' ',
- '<%= data["Plan Rows"] %>',
- ' | ',
- ' ',
- '<% if (typeof(data["Actual Loops"]) !== "undefined") {%>',
- '<%= data["Actual Loops"] %>',
- '<%}%>',
- ' | ',
- ' ',
- ' ',
- ' | ',
- '
',
- ].join(''));
-
- var _nodeExplainTableData = (_planData, _ctx) => {
- let node_info,
- display_text = ['