{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-@l10n/ja/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":["platform-badges","admonition"]},"type":"markdown"},"seo":{"title":"Treasure AI Studio - クエリ実行（Trino）","description":"自然言語でTrino SQLクエリを実行できます。AIがクエリを作成・実行し、結果を構造化されたテーブルとして表示します。","siteUrl":"https://docs.treasure.ai","lang":"en-US","jsonLd":{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://www.treasure.ai/","name":"Treasure AI","url":"https://www.treasure.ai/","logo":"https://www.treasure.ai/hubfs/assets/images/logos/primary-logo.svg"},{"@type":"WebSite","@id":"https://docs.treasure.ai/#website","name":"Treasure AI Documentation","url":"https://docs.treasure.ai/","inLanguage":["en","ja"],"publisher":{"@id":"https://www.treasure.ai/"}}]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"クエリ実行trino","__idx":0},"children":["クエリ実行（Trino）"]},{"$$mdtype":"Tag","name":"PlatformBadges","attributes":{"platforms":["Web","Desktop","Mobile"]},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["データに関する質問を平易な日本語で入力すると、Studioが最適化されたTrino SQLに変換し、アカウントに対して実行して結果を表示します。これらすべてがチャットストリーム内で完結します。SQLの完全な可視性により、結果に基づいて行動する前にすべてのクエリを確認できます。"]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"info","name":"注意"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["AIはサンドボックス実行環境内で",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["tdx query"]},"コマンドを使用してTrinoクエリを実行します。生成されたすべてのSQL文はツールコールの展開表示で確認できるため、独立してレビュー、コピー、再実行が可能です。"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"目的","__idx":1},"children":["目的"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["自然言語によるリクエストを通じてTreasure AIアカウントに対してTrinoクエリを実行し、会話内にインラインで構造化された読みやすい結果を受け取ります。"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"前提条件","__idx":2},"children":["前提条件"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Treasure AI Studioにサインイン済みであること（",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/ja/products/ai-studio/getting-started"},"children":["はじめに"]},"）"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Treasure AIアカウントでアクセス可能なデータベースが少なくとも1つあること"]}]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"aiを通じたクエリ実行","__idx":3},"children":["AIを通じたクエリ実行"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["データをクエリする最も簡単な方法は、求めていることを平易な言葉で説明することです。"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["「過去30日間で売上上位10名の顧客を表示してください」"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["「",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["pageviews"]},"テーブルには何行ありますか？」"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["「",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["mydb.users"]},"にはどのようなカラムがありますか？」"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["AIはリクエストをTrino SQLクエリに変換し、",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["tdx query"]},"を使用して実行し、結果をフォーマットされたテーブルとして表示します。これらすべてがチャットストリーム内で完結します。"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"内部での処理の流れ","__idx":4},"children":["内部での処理の流れ"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["クエリを自然言語で説明します"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["AIがSQLを作成し"]},"、Bashツール経由で実行します：",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["tdx query \"SELECT ...\""]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["ツールコールがチャットに表示され"]},"、実行中のコマンドを確認できます"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["クエリ結果が自動的に"]},"構造化されたテーブルとして表示されます（",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/ja/products/ai-studio/query/query-results"},"children":["クエリ結果テーブル"]},"を参照）"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["AIが結果を解釈し"]},"、会話を続けます"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["各ステップがリアルタイムで進行するのを確認できます。ツールコールインジケーターには実行中のコマンドが表示され、結果が届くと結果テーブルが自動的に展開されます。"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"特定のコマンドのリクエスト","__idx":5},"children":["特定のコマンドのリクエスト"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["クエリの構文と実行を正確に制御するには、実行したいコマンドをAIに直接指示します。"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"You: Run tdx query \"SELECT count(*) AS total_users FROM mydb.users\"\n"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["または、スキーマの簡易確認のために",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["tdx describe"]},"や",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["tdx show"]},"の使用を指示することもできます。"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"You: Describe the mydb.users table\nYou: Show me a preview of mydb.users\n"},"children":[]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"コマンド"},"children":["コマンド"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"目的"},"children":["目的"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"出力"},"children":["出力"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["tdx query \"<sql>\""]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["任意のTrino SQLを実行する"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["クエリ結果テーブル"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["tdx describe <db.table>"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["テーブルスキーマを表示する（カラム名と型）"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["スキーマテーブル"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["tdx show <db.table>"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["テーブルデータをプレビューする（デフォルト件数制限付きのSELECT *）"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["データテーブル"]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["完全なコマンドリファレンスについては、",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/ja/products/ai-studio/query/tdx-commands"},"children":["TDXコマンド"]},"を参照してください。"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"チャット内のクエリライフサイクル","__idx":6},"children":["チャット内のクエリライフサイクル"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["クエリが実行されると、チャットストリームに",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["ツールコールインジケーター"]},"が表示されます。"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"実行中","__idx":7},"children":["実行中"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["スピニングローダー"]},"アイコンがクエリの進行中を示します"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["コマンドの説明"]},"がモノスペースフォントで完全なコマンドプレビューとともに表示されます"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["実行中のSQLを正確に確認できます"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"完了時","__idx":8},"children":["完了時"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["緑色のチェックマーク"]},"がスピナーと置き換わります"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["ツールコールの行が",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["展開可能"]},"になります — クリックすると完全なコマンドと生の出力を確認できます"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["クエリ結果テーブル"]},"がツールコールの下に自動的に表示され、カラムヘッダー、型、フォーマットされたデータを含む構造化された結果が表示されます"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["実行統計"]},"がテーブルの下に表示されます（詳細は",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/ja/products/ai-studio/query/query-results"},"children":["クエリ結果テーブル"]},"を参照）"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["実行時間バッジ"]},"が1秒以上の場合に実行時間を表示します（例：「3.2s」）"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"エラー時","__idx":9},"children":["エラー時"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["赤いXアイコン"]},"がクエリの失敗を示します"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["「クエリが失敗しました」エラーカードが以下の情報とともに表示されます：",{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["実行されたSQL（モノスペースフォント）"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["クエリエンジンからのエラーメッセージ"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["トラブルシューティング用の",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["ジョブID"]}]}]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["ツールがゼロ以外のステータスで終了した場合、",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["終了コードバッジ"]},"（例：「Exit 1」）が表示されます"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"クエリの停止","__idx":10},"children":["クエリの停止"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["AIの応答の一部としてクエリが実行中の場合、チャット入力エリアの",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["停止"]},"ボタン（四角いアイコン）をクリックしてAIの実行ストリームを中断できます。"]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"info","name":"注意"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["応答を停止すると、AIの実行ストリームが終了します。クエリ自体はTrinoエンジン上で引き続き実行される場合があります。長時間実行されているクエリをキャンセルする必要がある場合は、Treasure AIコンソールを使用してください。"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"クエリの検出","__idx":11},"children":["クエリの検出"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["StudioはBashツールコールからクエリ結果を自動的に検出します。UIは以下を含むコマンドを認識します。"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["tdx query"]},"、",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["tdx describe"]},"、",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["tdx show"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["trino"]},"、",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["presto"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["psql"]},"、",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["mysql"]},"、",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["sqlite3"]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["検出された場合、生の出力はプレーンテキストとして表示されるのではなく、構造化されたテーブルとして解析されます。2つの出力フォーマットが認識されます。"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"フォーマット"},"children":["フォーマット"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"説明"},"children":["説明"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["JSON配列"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["[{\"col1\": val1, ...}, ...]"]}," — ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--json"]},"フラグによって生成される"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["罫線テーブル"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["┌─│├┤┘"]},"文字を使用したUnicodeテーブル形式 — ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["tdx query"]},"のデフォルト出力"]}]}]}]}]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"info","name":"技術的な注意"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["クエリの検出は",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["detectQueryResult()"]},"関数を介してクライアント側で行われます。この関数はBashコマンド文字列と出力フォーマットを検査します。Bashツールコールがクエリコマンドパターンにマッチし、その出力に有効なJSON配列または罫線テーブル文字が含まれている場合、出力はプレーンテキストの代わりに",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["QueryResultTable"]},"コンポーネントとして表示されます。ストリーミング中に結果が検出されると、テーブルは自動的に展開されます。"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"クエリ最適化のためのスキルの活用","__idx":12},"children":["クエリ最適化のためのスキルの活用"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["複雑なクエリの場合、作業フォルダ設定で組み込みのSQLスキルを有効化することで、レイテンシを削減し効率を向上させることができます。"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"スキル"},"children":["スキル"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"機能"},"children":["機能"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["sql-skills:trino"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Treasure AIのベストプラクティスに基づいたTrino SQLを作成する"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["sql-skills:hive"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["重い処理向けのHive SQLを作成する"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["sql-skills:time-filtering"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["時間ベースのクエリに",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["td_interval"]},"とパーティションプルーニングを適用する"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["sql-skills:trino-optimizer"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["低速なTrinoクエリを分析・最適化する"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["sql-skills:trino-to-hive-migration"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["メモリ消費の多いTrinoクエリをHiveに変換する"]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["例：",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["sql-skills:trino-optimizer"]},"スキルが有効な状態で、クエリのレイテンシのボトルネックを分析するようAIに依頼します。パーティションプルーニング、述語プッシュダウン、その他の最適化が提案されます。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["完全なスキルカタログについては、",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/ja/products/ai-studio/skills/skills"},"children":["スキルとマーケットプレイス"]},"を参照してください。"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"ベストプラクティス","__idx":13},"children":["ベストプラクティス"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["まず自然言語から始めましょう。"]}," AIにクエリの初稿を作成させてください。結果を解釈する前に、ツールコール内のSQLを確認してください。"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["クエリの前に",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["tdx describe"]},"を使用しましょう。"]}," スキーマ（カラム名、型）を理解することで、あなたとAIの両方が正確なクエリを作成しやすくなります。"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["データベースコンテキストを設定しましょう。"]}," セッションの開始時にAIに",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["tdx use database mydb"]},"を実行させることで、すべてのクエリで完全修飾テーブル名を入力する手間を省けます。"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["生成されたSQLを確認しましょう。"]}," AIはあなたの説明と検出したスキーマに基づいてSQLを作成します。結果に基づいて行動する前に、必ずツールコールの展開表示でクエリを確認してください。"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["大きな結果セットには出力フォーマットフラグを使用しましょう。"]}," 大きな結果セットを処理する必要がある場合、AIに",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--json"]},"（構造化出力）または",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--output results.csv"]},"（ファイルへの保存）の使用を指示してください。"]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"確認","__idx":14},"children":["確認"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"input","attributes":{"checked":false,"type":"checkbox","readOnly":true},"children":[]}," 「[your_database].[your_table]には何行ありますか？」と質問し、",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["tdx query"]},"を実行するツールコールが表示されることを確認する"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"input","attributes":{"checked":false,"type":"checkbox","readOnly":true},"children":[]}," 結果がカラムヘッダーと型を含む構造化されたテーブルとして表示されることを確認する"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"input","attributes":{"checked":false,"type":"checkbox","readOnly":true},"children":[]}," ツールコールを展開して完全なSQLと生の出力を確認する"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"トラブルシューティング","__idx":15},"children":["トラブルシューティング"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"問題"},"children":["問題"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"解決策"},"children":["解決策"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["クエリに時間がかかりすぎる"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["sql-skills:trino-optimizer"]},"スキルを使用してレイテンシの問題を分析してください。一般的な原因：フルテーブルスキャン（パーティションプルーニングを追加）、過剰なJOIN、時間カラムのWHERE句の欠如"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["「アクセスが拒否されました」でクエリが失敗する"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Treasure AIアカウントがデータベースとテーブルへのアクセス権を持っていることを確認してください。AIに",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["tdx databases"]},"を実行させて利用可能なデータベースを確認してください"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["AIが誤ったSQLを作成する"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["クエリリクエストの前に",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["sql-skills:trino"]},"スキルを有効化してください。これによりAIにTreasure AI固有のSQLパターンと関数が提供されます"]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"次のステップ","__idx":16},"children":["次のステップ"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/ja/products/ai-studio/query/query-results"},"children":["クエリ結果テーブル"]}," — フォーマット、カラム型、統計情報"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/ja/products/ai-studio/query/tdx-commands"},"children":["TDXコマンド"]}," — 完全なCLIコマンドリファレンス"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/ja/products/ai-studio/skills/skills"},"children":["スキルとマーケットプレイス"]}," — 最適化とベストプラクティスのためのSQLスキル"]}]}]},"headings":[{"value":"クエリ実行（Trino）","id":"クエリ実行trino","depth":1},{"value":"目的","id":"目的","depth":2},{"value":"前提条件","id":"前提条件","depth":2},{"value":"AIを通じたクエリ実行","id":"aiを通じたクエリ実行","depth":2},{"value":"内部での処理の流れ","id":"内部での処理の流れ","depth":3},{"value":"特定のコマンドのリクエスト","id":"特定のコマンドのリクエスト","depth":2},{"value":"チャット内のクエリライフサイクル","id":"チャット内のクエリライフサイクル","depth":2},{"value":"実行中","id":"実行中","depth":3},{"value":"完了時","id":"完了時","depth":3},{"value":"エラー時","id":"エラー時","depth":3},{"value":"クエリの停止","id":"クエリの停止","depth":2},{"value":"クエリの検出","id":"クエリの検出","depth":2},{"value":"クエリ最適化のためのスキルの活用","id":"クエリ最適化のためのスキルの活用","depth":2},{"value":"ベストプラクティス","id":"ベストプラクティス","depth":2},{"value":"確認","id":"確認","depth":2},{"value":"トラブルシューティング","id":"トラブルシューティング","depth":2},{"value":"次のステップ","id":"次のステップ","depth":2}],"frontmatter":{"seo":{"title":"Treasure AI Studio - クエリ実行（Trino）","description":"自然言語でTrino SQLクエリを実行できます。AIがクエリを作成・実行し、結果を構造化されたテーブルとして表示します。"},"platforms":["Web","Desktop","Mobile"]},"lastModified":"2026-07-08T07:33:25.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/ja/products/ai-studio/query/query-execution","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}