GBase 8a MPP Cluster provides two command-line client tools—gccli and gncli—for connecting to the database and executing SQL statements. Mastering their parameters can significantly improve daily operational efficiency. Below is a summary of commonly used options.
Connection and Basic Parameters
-
-h: Specifies the IP address(es) to connect to. Multiple IPs can be separated by commas to support high availability. -
-u: Database username. -
-p: Database password. -
-P: Specifies the port number. -
-D: Sets the default database to use.
Execution and Output Control
-
-e: Executes a given SQL statement directly without entering interactive mode. -
-E: Displays results vertically, similar to appending\Gto a query. -
-N: Suppresses column names in the result set, returning only data. -
-s: Enables silent mode, reducing the amount of output. -
-vvv: Outputs detailed execution information, including execution time, which is useful for debugging and performance analysis.
Behavior Control
-
-c: Allows the use of hints. By default, content inside/* */is treated as a comment and filtered out. With-c, such content is sent to the server as a hint. -
-f: When executing multiple SQL statements, if an error occurs, the client skips the failing statement and continues with the rest. -
-q: Enables unbuffered output. By default,gcclibuffers the entire result set in memory before displaying it, reducing I/O operations. However, for large result sets, this can consume significant memory. Using-qoutputs results directly, reducing memory pressure.
These parameters cover common needs ranging from connection management to execution behavior. Combining them flexibly allows you to adapt to various development and operational scenarios when working with the gbase database. For users of GBASE products, understanding these options helps make daily interactions with the database more efficient and tailored to specific workflows.
Top comments (0)