---
title: Backfill Support for SQL++
description: Configure the temporary working space for the SQL++ engine and its
  embedded GSI client.
pubDate: 2026-08-17T09:53:44.266Z
antora:
  editUrl: https://github.com/couchbaselabs/docs-devex/edit/release/7.2/modules/n1ql/pages/n1ql-language-reference/backfill.adoc
  xref: xref:7.2@server:n1ql:n1ql-language-reference/backfill.adoc[]
---

[Consult the llms.txt file for a full list of contents](/llms.txt)
[View original HTML](/server/7.2/n1ql/n1ql-language-reference/backfill.html)

# Backfill Support for SQL++

> Configure the temporary working space for the SQL++ engine and its embedded GSI client. 

## [](#introduction)Introduction

When a query has an extremely large corresponding index scan, the indexer `gsiClient` buffers the results into the `/tmp` directory. Since this method has caused some high I/O and works differently on Windows, Couchbase Server enables you to configure the backfill directory via the UI, which will then pass the settings to the server.

## [](#prerequisites)Prerequisites

The user must have _Cluster Admin_ privileges in order to be able to specify and configure the location for temporarily storing any transient-data during query processing per query-engine.

## [](#configuration)Configuration

In the Query Workbench > Settings page, click **Advanced Query Settings** to see: ![backfill QueryTempDiskPath circled](../_images/backfill_QueryTempDiskPath_circled.png)

In the **Query Temp Disk Path** textbox, enter the directory you want to use for your backfill file.

In the **Quota** textbox, enter the number of megabytes for the maximum size of your backfill file.

Your system administrator can read and modify the two REST backfill parameters:

| Setting                | Description                                                                 | Values                                                    | Remarks                                                    |
| ---------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------- | ---------------------------------------------------------- |
| query\_tmpspace\_dir   | The temp directory in which the indexer can create the scan\_backfill file. | Default value is /tmp                                     | Only absolute paths are allowed.                           |
| query\_tmpspace\_limit | The maximum limit in MB for the temporary file size.                        | 0 will disable backfill. \-1 means the size is unlimited. | The max size is limited only by your available disk space. |

## [](#examples)Examples

* [Ex 1: Curl request to get the current temp file size.](#Ex1)
* [Ex 2: Curl request to change the temp file directory to tmp2](#Ex2)
* [Ex 3: Curl request to change the temp file size to 2048 MB.](#Ex3)

Example 1\. Curl request to get the current "Advanced Query Settings"

```console
$ curl --GET -u Administrator:password http://localhost:8091/settings/querySettings
```

Results

```json
{"queryTmpSpaceDir":"/opt/couchbase/tmp","queryTmpSpaceSize":5120,"queryCurlWhitelist":{"all_access":false,"allowed_urls":["http://localhost:8091/settings/querySettings",""],"disallowed_urls":[""]}}
```

Example 2\. Curl request to change the temp file directory to `tmp2` (after making a `tmp2` directory)

```console
$ curl -X POST -u Administrator:password -d 'queryTmpSpaceDir=/opt/couchbase/tmp2'  http://localhost:8091/settings/querySettings
```

Results

```json
{"queryTmpSpaceDir":"/opt/couchbase/tmp2","queryTmpSpaceSize":5120,"queryCurlWhitelist":{"all_access":false,"allowed_urls":["http://localhost:8091/settings/querySettings",""],"disallowed_urls":[""]}}
```

Example 3\. Curl request to change the temp file size to 2048 MB

```console
$ curl -X POST -u Administrator:password -d 'queryTmpSpaceDir=/opt/couchbase/tmp' -d 'queryTmpSpaceSize=2048' http://localhost:8091/settings/querySettings
```

Results

```json
{"queryTmpSpaceDir":"/opt/couchbase/tmp","queryTmpSpaceSize":2048,"queryCurlWhitelist":{"all_access":false,"allowed_urls":["http://localhost:8091/settings/querySettings",""],"disallowed_urls":[""]}}
```

At the same time, the logs will contain messages for every change coming from both query and GSI, so after executing Example 3's CURL statement:

_time=2017-12-06T14:12:39.709-08:00 _level=INFO _msg=New settings received: {"query.settings.tmp_space_dir":"/opt/couchbase/tmp/","query.settings.tmp_space_size":2048}

_time=2017-12-06T14:12:39.712-08:00 _level=INFO _msg=Settings notifier from metakv

2017-12-06T14:12:39.715-08:00 [Info] GSIC - Setting config map[query_tmpspace_dir:/opt/couchbase/tmp/ query_tmpspace_limit:2048]

_time=2017-12-06T14:12:39.715-08:00 _level=INFO _msg= Indexer settings have been updated map[query_tmpspace_dir:/opt/couchbase/tmp/ query_tmpspace_limit:2048]