Inline SQL Commands

When connecting to the database, Heimdall exposes a few commands that are handled directly by Heimdall vs. by the database. Note: These interceptions ONLY occur when using the simple query protocol via a tool such as PSQL. If your tool uses a prepared interface, as many GUI tools will, these command will not be intercepted.

Show commands

The key use cases for Heimdall database proxy include:

(Postgres only)

  • show databases
  • show schemas
  • show tables
  • show users

All databases:

  • show pools
  • show connections
  • show keymap: displays the keymap used for tracking external caches
  • show querytracker : displays relevant tracking information for queries tracked in Heimdall, table and count are optional. Only used for cache auto-repopulation (rarely used)
  • show queryinfo: Displays attributes associated with the previous query.
  • drop connection: When in proxy mode, force the connection to drop--useful for using test tools that don't close connections on their own.
  • clear pool : clear the server-side connections for a particular user pool--note, must include the databasename:username as displayed in the show pools command.

Note: To issue clear pool, the user must be authenticated as the users "postgres", "gpadmin", "root", "sa" or "admin". This will be changed to be configurable in the future.

Control Commands

  • set querytimeout: Sets the number of seconds the driver will wait for a Statement object to execute to the given number of seconds. If the limit is exceeded, an SQLException is thrown.
  • set cachepool: Adds a value to the cache key to provide unique cache "pools" depending on external factors, unobserved by Heimdall