Default login for Mclient
A common way to connect to a DB server is to use:
mclient -u<user> [options or database]
The user is then prompted for a password (a user will also be asked for if -u is not specified).
An faster method is to create a file .monetdb in the home folder. The following syntax is to be used:
By default, Mclient will use these credentials, no need to specify a user or input a password.
Mclient options and commands
Two basic but powerful sources of information:
in a Mclient SQL session
A few useful SQL commands
Inspecting the catalog
The table tables lists all the relations and views used in the current session. Within this table, the field type indicates the type of object: 0 for table, 1 for view.
User tables and views can be listed as follows:
SELECT * FROM tables WHERE system = false;
System tables (describing, e.g. schemas, users, types) are also listed in tables, with self-explanatory names.
Debugging a query
The following can be used:
Ouputs a high level view view of the query plan
Outputs the query decomposition into a MAL plan.
Provides timings and information about the query execution
Launches a GDB-like interface for a step-by-step analysis of the query.
Optimizer modules in use
It can sometimes be useful to select a minimal optimizer configuration:
SET optimizer = 'minimal_pipe';
SQL Function lookup
SELECT * FROM functions;
More info in source code file:
Copy into Table
Assume the Separators are
- | between attributes
- newline between records
- " as string quotes
copy into targettable from 'inputdata.csv' using delimiters '|', '\n', '\;