Getting wi script help
To get pseudo-recommendations for learning, or testing purposes, you need to know the Workload Insights (wi) script options. You run your first wi script to get online help.
- Go to the github directory where you downloaded and built the project.
-
Run the wi script with no options to get online help about script usage and
options:
$ ./wiOutput looks something like this:usage: wi -i <file_1,...,file_N> [-o <directory>] [-c <configfile>] [-u <url>] [-n <username>] [-p <password>] [-t <threshold>] [-f <format>] [-r <recommendation>] [-l <level>][-d]-i,--input <file_1,...,file_N>one or more .sql/.json files or a directory (version Y)-o,--output <directory>output directory-c,--config <configfile>path to configuration .properties) file-u,--url <url>JDBC url to connect to-n,--username <username>username to connect as-p,--password <password>password to connect as-t,--tables-threshold <threshold>the threshold controlling above which a table subset is considered interesting if it is estimated to contribute to total workload cost above this threshold (between 0 and 1). The default is 0.1 (10% of total workload cost)-f,--format <format>output format TEXT(Default)/JSON-r,--recommendation <recommendation>the kind of recommendations to include in the report: - SPJ for SELECT-PROJECT-JOIN recommendations - SPJA for SELECT-PROJECT-JOIN-AGGREGATE recommendations - ALL for both SPJ and SPJA recommendations (DEFAULT)-l,--level <level>the level of detail to display in the report: - MINIMAL displays only the view recommendations - DEFAULT displays recommendations along with basic information about the query workload - FULL displays all information available in the report (useful for debugging purposes)-d, --deletesuggest which materialized views, not used by a given workload could be deleted. Requires JDBC information to be provided. Available in version Y.usage: wi -i <directory> [-o <directory>] [-c <configfile>] [-u <url>] [-n <username>] [-p <password>] [-t <threshold>] [-f <format>] [-r <recommendation>] [-l <level>] -i,--input <directory> input directory with .sql/.json files -o,--output <directory> output directory -c,--config <configfile> path to configuration (.properties) file -u,--url <url> JDBC url to connect to -n,--username <username> username to connect as -p,--password <password> password to connect as -t,--tables-threshold <threshold> the threshold controlling above which a table subset is considered interesting if it is estimated to contribute to total workload cost above this threshold (between 0 and 1). The default is 0.1 (10% of total workload cost) -f,--format <format> output format TEXT(Default)/JSON -r,--recommendation <recommendation> the kind of recommendations to include in the report: - SPJ for SELECT-PROJECT-JOIN recommendations - SPJA for SELECT-PROJECT-JOIN-AGGREGATE recommendations - ALL for both SPJ and SPJA recommendations (DEFAULT) -l,--level <level> the level of detail to display in the report: - MINIMAL displays only the view recommendations - DEFAULT displays recommendations along with basic information about the query workload - FULL displays all information available in the report (useful for debugging purposes) -
Try the recommender examples.
A text report that has the following information appears:
-
View recommendations for the workload.
-
Queries in the workload, along with the recommendations for each query (if available), and other information.
-
-
Stop the mini-hs2.
docker stop mini-hs2 -
Remove the mini-hs2.
docker rm mini-hs2
