# (補足) クエリ実行とキャッシュ

様々な場面で、クエリ実行ごとにキャッシュを作成・活用し、不要なバックグラウンドジョブを防いでいます。

これにより、スキャンするデータ量を削減し、実行結果をより速く取得することができます。

## **クエリ実行**

以下の機能においてクエリが実行されます。

* [ドキュメントページ](/data-exploration/notebook/doc-page.md)
  * すべて実行、最新データですべて実行
  * [SQLブロック](/data-exploration/notebook/sql-block.md)
    * 実行、最新データで実行
* [グリッドページ](/data-exploration/notebook/grid-page.md)
  * すべて実行、最新データですべて実行
* [レポート](/sharing/report.md)・[署名付き埋め込み](/sharing/signed-embed.md)
  * 更新
  * 自動実行
* クエリ
  * 実行
* 各種機能におけるテーブルのプレビュー機能

## **ウェアハウス側のキャッシュ**

SQL文が変更されない場合、ウェアハウス側のキャッシュ（例：[BigQueryのキャッシュされたクエリ実行結果](https://cloud.google.com/bigquery/docs/cached-results)）が使用されます。SQLチェインを使用する場合、中間SQLの結果は自動的にキャッシュテーブルを使用するように書き換えられます。

## **ノートブックとレポートの小規模キャッシュ**

* 1000行までのSQL実行結果は、ノートブックと紐づけてキャッシュとして保存されます。チャートなどのコンポーネントは、この1000行までの実行結果を利用できます。
* 24時間以内に同じSQLが再度実行された場合、保存された表示用データが取得され、新しいジョブの実行はスキップされます。
  * 新しいジョブで実行したい場合は `最新データですべて実行` を選択して結果を更新してください。
* レポートのキャッシュ有効時間はレポート設定から変更可能です。

{% hint style="info" %}
テーブルのプレビュー機能については閲覧時に都度データ取得されるため、キャッシュは利用されません。
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.codatum.jp/data-exploration/appendix-cache.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
