|
508 | 508 | const Mode = {
|
509 | 509 | INPUT: 'input',
|
510 | 510 | TREE: 'tree',
|
511 |
| - GRAPH: 'graph' |
| 511 | + GRAPH: 'graph', |
| 512 | + HELP: 'help' |
512 | 513 | }
|
513 | 514 |
|
514 | 515 | class Analysis extends React.Component {
|
|
754 | 755 |
|
755 | 756 | var d = 30;
|
756 | 757 | var s = 1;
|
| 758 | + |
| 759 | +function Help() { |
| 760 | + const operatorDoc = (operator, ...definition) => |
| 761 | + elp( |
| 762 | + 'li', |
| 763 | + [ |
| 764 | + elp('i', operator), |
| 765 | + ...definition |
| 766 | + ]); |
| 767 | + |
| 768 | + return elp( |
| 769 | + 'div', |
| 770 | + [ |
| 771 | + elp('h2', '-- How to use this tool --'), |
| 772 | + elp( |
| 773 | + 'p', |
| 774 | + [ |
| 775 | + 'Paste a printed query plan in the "input" section of the tool and click on "Analyse".', |
| 776 | + 'The format should be in the format of the above extract:' |
| 777 | + ]), |
| 778 | + elp( |
| 779 | + 'pre', |
| 780 | +`Retrieval #0: BitmapPrimitiveAggregatesRetrieval |
| 781 | + Location= dimension 0@dimension 0:currency\\desk\\type=[*]\\[*]\\[*],dimension 1@dimension 1:year=[*] |
| 782 | + Measures= [value.SUM] |
| 783 | + Filter= Global query filter |
| 784 | + Partitioning= Constant partitioning |
| 785 | + Measures provider= SimpleMeasuresProvider |
| 786 | +
|
| 787 | +Retrieval #1: PostProcessedAggregatesRetrieval |
| 788 | + ...`), |
| 789 | + elp( |
| 790 | + 'p', |
| 791 | + [ |
| 792 | + 'This will create a collapse tree representation of the graph - section "Tree", replicated every node in the', |
| 793 | + 'stack - unlike the string representation that refers to a previous printed entry.', |
| 794 | + ]), |
| 795 | + elp( |
| 796 | + 'p', |
| 797 | + [ |
| 798 | + 'A visual graph of the query is available under the section "Graph". It displays the connections between', |
| 799 | + 'every operation and use colors to distinguish the various steps.' |
| 800 | + ]), |
| 801 | + elp('h2', '-- Filtering a view --'), |
| 802 | + elp( |
| 803 | + 'p', |
| 804 | + [ |
| 805 | + 'It is possible to filter the graph using several operators. One can use multiple operators, separated', |
| 806 | + 'by spaces. All operators are applied and must provide a positive match for an operation to be retained.' |
| 807 | + ]), |
| 808 | + elp('h3', 'Filtering operators'), |
| 809 | + elp( |
| 810 | + 'ul', |
| 811 | + [ |
| 812 | + operatorDoc( |
| 813 | + 'from: <id>', |
| 814 | + ': retains the operation tree for a root operation whose id is <id>.'), |
| 815 | + operatorDoc( |
| 816 | + 'to: <id>', |
| 817 | + ': retains the operation tree to a leaf operation whose id is <id>.'), |
| 818 | + operatorDoc( |
| 819 | + 'by: <id>', |
| 820 | + ': retains the operation trees that include the operation whose id is <id>.'), |
| 821 | + operatorDoc( |
| 822 | + 'type: <t>', |
| 823 | + ': filter the graph to retain only operations of the given type.', |
| 824 | + elp('br'), |
| 825 | + 'This filter is used as a case-insensitive RegExp pattern upon the operation type.', |
| 826 | + elp('br'), |
| 827 | + 'Any matching operation is retained, as well as their descendants and their parents.'), |
| 828 | + operatorDoc( |
| 829 | + 'measures: <m1, m2, ...>', |
| 830 | + ': filter the graph to retain only operations whose measure lists contain every listed measures.', |
| 831 | + elp('br'), |
| 832 | + 'This filter only tests that the provided measure names are included in the listed measures.', |
| 833 | + ' There are currently no mechanism to request for a full match', |
| 834 | + elp('br'), |
| 835 | + 'Any matching operation is retained, as well as their descendants and their parents.'), |
| 836 | + operatorDoc( |
| 837 | + 'location: <p1, p2, ...>', |
| 838 | + ': filter the graph to retain only operations whose locations contain every listed location patterns.', |
| 839 | + elp('br'), |
| 840 | + 'This filter only tests that the patterns are included in the location stringified value.', |
| 841 | + ' There are currently no mechanism to request for a full match', |
| 842 | + elp('br'), |
| 843 | + 'Any matching operation is retained, as well as their descendants and their parents.'), |
| 844 | + ]) |
| 845 | + ]); |
| 846 | +} |
| 847 | + |
757 | 848 | class App extends React.Component {
|
758 | 849 | constructor(props) {
|
759 | 850 | super(props);
|
|
914 | 1005 | return this.renderResults();
|
915 | 1006 | case Mode.INPUT:
|
916 | 1007 | return this.renderInput();
|
| 1008 | + case Mode.HELP: |
| 1009 | + return elp(Help); |
917 | 1010 | default:
|
918 | 1011 | return elp('div', `Unknown mode ${this.state.mode}`);
|
919 | 1012 | }
|
|
0 commit comments