PAUSE JOB

The PAUSE JOB statement lets you pause IMPORT jobs, enterprise BACKUP and RESTORE jobs, user-created table statistics jobs, automatic table statistics jobs, and changefeeds.

After pausing jobs, you can resume them with RESUME JOB.

Note:
You cannot pause schema changes.

Required privileges

By default, only the root user can control a job.

Synopsis

PAUSEJOBjob_idJOBSselect_stmt

Parameters

ParameterDescription
job_idThe ID of the job you want to pause, which can be found with SHOW JOBS.
select_stmtA selection query that returns job_id(s) to pause.

Examples

Pause a single job

  1. > SHOW JOBS;
  1. +----------------+---------+-------------------------------------------+...
  2. | id | type | description |...
  3. +----------------+---------+-------------------------------------------+...
  4. | 27536791415282 | RESTORE | RESTORE db.* FROM 'azure://backup/db/tbl' |...
  5. +----------------+---------+-------------------------------------------+...
  1. > PAUSE JOB 27536791415282;

Pause multiple jobs

To pause multiple jobs, nest a SELECT clause that retrieves job_id(s) inside the PAUSE JOBS statement:

  1. > PAUSE JOBS (SELECT job_id FROM [SHOW JOBS]
  2. WHERE user_name = 'maxroach');

All jobs created by maxroach will be paused.

Pause automatic table statistics jobs

  1. > SHOW AUTOMATIC JOBS;
  1. job_id | job_type | description |...
  2. +--------------------+---------------------+-----------------------------------------------------+...
  3. 438235476849557505 | AUTO CREATE STATS | Table statistics refresh for defaultdb.public.users |...
  4. (1 row)
  1. > PAUSE JOB 438235476849557505;

To permanently disable automatic table statistics jobs, disable the sql.stats.automatic_collection.enabled cluster setting:

  1. > SET CLUSTER SETTING sql.stats.automatic_collection.enabled = false;

See also

Was this page helpful?
YesNo