YSQL configuration parameters play an important role in optimizing and enhancing database performance.
The YSQL SHOW command allows inspection of the current value of any parameter.
Example:
yugabyte=# SHOW max_connections;
max_connections
-----------------
300
(1 row)
There are 300+ parameters so remembering the full name of any one parameter is quite difficult.
If you remember atleast a portion of the parameter name, you can find it with a wildcard search.
Example (trying to SHOW parameter(s) named like “follower”):
yugabyte=# SHOW *follower*;
ERROR: syntax error at or near "*"
LINE 1: SHOW *follower*;
^
Opps, that didn’t work!
To do a wildcard search, we can make use of the \o meta-command that is typically used to send all query results to a file.
The trick to allow us to perform a wildcard search is to pipe all output to the Linux grep command, and then let grep do its thing!
Example (trying to SHOW parameter(s) named like “follower”):
yugabyte=# \o | grep follower
yugabyte=# SHOW ALL;
yb_follower_read_staleness_ms | 30000 | Sets the staleness (in ms) to be used for performing follower reads.
yb_read_from_followers | off | Allow any statement that generates a read request to go to any node.
Don’t forget to turn off outputting everything to grep by simply issuing the \o meta-command by itself.