Skip to content

Commit 3cd0470

Browse files
committed
Add a small documentation section to the query plan analyser.
1 parent c9b69b2 commit 3cd0470

File tree

1 file changed

+94
-1
lines changed

1 file changed

+94
-1
lines changed

Diff for: queryplan-analyzer/index.html

+94-1
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,8 @@
508508
const Mode = {
509509
INPUT: 'input',
510510
TREE: 'tree',
511-
GRAPH: 'graph'
511+
GRAPH: 'graph',
512+
HELP: 'help'
512513
}
513514

514515
class Analysis extends React.Component {
@@ -754,6 +755,96 @@
754755

755756
var d = 30;
756757
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+
757848
class App extends React.Component {
758849
constructor(props) {
759850
super(props);
@@ -914,6 +1005,8 @@
9141005
return this.renderResults();
9151006
case Mode.INPUT:
9161007
return this.renderInput();
1008+
case Mode.HELP:
1009+
return elp(Help);
9171010
default:
9181011
return elp('div', `Unknown mode ${this.state.mode}`);
9191012
}

0 commit comments

Comments
 (0)