aboutsummaryrefslogtreecommitdiff
path: root/app/components/plan-node/plan-node.html
blob: ddf672295bbf6ebdd946f30c090295d2286ba618 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<div class="plan-node">
   <header (click)="showDetails = !showDetails">
      <h4>{{node['Node Type'] | uppercase}}
      </h4>
      <span class="node-duration">{{duration}}<span class="text-muted">{{durationUnit}} | </span>
      <strong>{{executionTimePercent}}</strong><span class="text-muted">%</span>
      </span>
   </header>

   <div class="relation-name" *ngIf="node['Relation Name']">
      <button *ngIf="plan.formattedQuery" class="btn btn-sm btn-default btn-slim pull-right" (click)="showQuery = !showQuery">
         <i class="fa fa-database"></i>
      </button>

      <span class="text-muted">on </span>
      <span *ngIf="node['Schema']">{{node['Schema']}}.</span>{{node['Relation Name']}}
      <span *ngIf="node['Alias']"> ({{node['Alias']}})</span>
   </div>

   <div class="relation-name" *ngIf="node['Group Key']"><span class="text-muted">by</span> {{node['Group Key']}}</div>
   <div class="relation-name" *ngIf="node['Sort Key']"><span class="text-muted">by</span> {{node['Sort Key']}}</div>
   <div class="relation-name" *ngIf="node['Join Type']">{{node['Join Type']}} <span class="text-muted">join</span></div>
   <div class="relation-name" *ngIf="node['Index Name']"><span class="text-muted">using</span> {{node['Index Name']}}</div>

   <div class="tags" *ngIf="viewOptions.showTags && tags.length > 0">
      <span *ngFor="#tag of tags">{{tag}}</span>
   </div>

   <div *ngIf="currentHighlightType !== highlightTypes.NONE">
      <div class="node-bar-container" [style.width]="(MAX_WIDTH+3)+'px'">
         <span class="node-bar" [style.width]="width+'px'" [style.backgroundColor]="backgroundColor"></span>
      </div>
      <span class="node-bar-label">
         <span class="text-muted">{{viewOptions.highlightType}}:</span> {{highlightValue | number:'.0-2'}}
      </span>
   </div>

   <div class="planner-estimate" *ngIf="viewOptions.showPlannerEstimate">
      <span *ngIf="plannerRowEstimateDirection === estimateDirections.over"><strong>over</strong> estimated rows</span>
      <span *ngIf="plannerRowEstimateDirection === estimateDirections.under"><strong>under</strong> estimated rows</span>
      <span> by <strong>{{plannerRowEstimateValue}}</strong>x</span>
   </div>

   <table  *ngIf="showDetails" class="table prop-list">
      <tr *ngFor="#prop of props">
         <td width="40%">{{prop.key}}</td>
         <td>{{prop.value}}</td>
      <tr>
   </table>

   <div *ngIf="showQuery" class="plan-query-container">
      <button class="btn btn-close pull-right" (click)="showQuery = false">
         <i class="fa fa-close"></i>
      </button>
      <h3>query</h3>
      <pre class="plan-query-text"><code [innerHTML]="getFormattedQuery()"></code></pre>
   </div>
</div>

<ul *ngIf="node.Plans">
  <li *ngFor="#subNode of node.Plans">
    <plan-node [plan]="plan" [node]="subNode" [viewOptions]="viewOptions" [planStats]="planStats"></plan-node>
  </li>
</ul>