Controlling queries

The following commands can be used to display or stop the queries running on the database:

SHOW PROCESS

Syntax: 

SHOW PROCESSES [ LIMIT size ]    
    

Displays the following information about the running queries: id, SQL code, start time, number of output rows, user running the query. The optional LIMIT clause forces the display of the SQL code to be limited to size bytes.

Note

  • The user issuing the command can always see his/her queries (the sql column).

  • The user can see the queries of other users who permit that (the s property).

  • An administrator can see all queries of all users, regardless of their properties.

  • Processes can also be displayed from the user interface level.

Syntax: 

SHOW ALL PROCESSES       
    

Display all processes in all catalogs running in a remote database.

KILL PROCESS

Syntax: 

KILL PROCESS process-id    
    

Stops the running query. Can be issued only by adminstartors or the user who launched the process.

Note

This operation can also be performed form the User interface level.

PAUSE PROCESS

Syntax: 

PAUSE PROCESS process-id 
	

Sends a request to the database engine to pause the query with the given id. There is no guarantee that the query will be paused.

RESUME PROCESS

Syntax: 

RESUME PROCESS process-id 
	

Resumes the execution of a paused query.