{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-@l10n/ja/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":["admonition"]},"type":"markdown"},"seo":{"title":"論理ビュー","description":"Treasure Data Product Documentation · Collect and Unify · Segment and Activate · Experiment and Analyze · Decisioning Automate with AI Scale and Trust.","siteUrl":"https://docs.treasuredata.com","lang":"en-US","llmstxt":{"hide":false,"sections":[{"title":"Table of contents","includeFiles":["**/*"],"excludeFiles":[]}],"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"論理ビュー","__idx":0},"children":["論理ビュー"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["論理ビューは、SQLクエリによって定義される仮想テーブルです。物理テーブルとは異なり、論理ビューはデータを保存しません。代わりに、ビューがクエリされるたびに、基盤となるテーブルから動的に結果を計算します。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["論理ビューは現在、Trinoのみで利用可能です。Hiveのサポートは将来のリリースで予定されています。"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"メリットとユースケース","__idx":1},"children":["メリットとユースケース"]},{"$$mdtype":"Tag","name":"p","attributes":{},"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":["変更の増幅の削減"]},": 複数のクエリを修正する代わりに、データ変換を1か所で更新できます"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["仮想データマート"]},": データを複製せずに論理的なデータ構造を作成できます"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["BIツールの互換性"]},": Treasure Dataのネイティブ型をBIツール互換の型（例：timestamp）に変換できます"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"一般的なユースケース","__idx":2},"children":["一般的なユースケース"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["BIツールのタイムスタンプ互換性"]},": PlazmaDBテーブルは、タイムスタンプをUnix時間（整数）または文字列として保存します。タイムスタンプ列を持つ論理ビューを作成することで、BIツールがカスタム計算なしで直接タイムスタンプフィールドを使用できるようになります。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["イベントログの変換"]},": イベントログ（Engage StudioからのEmail Open/Bounce/Clickイベントなど）を、顧客またはメールアドレスごとの集計メトリクスに変換し、分析を容易にします。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["複雑なクエリの簡素化"]},": 共通のフィルタリング、集計、または結合ロジックをビューにカプセル化し、データアナリストが直接クエリできるようにします。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["データマスキングとセキュリティ"]},": DEFINERモードを使用して、ユーザーに直接のテーブルアクセスを許可せずに、特定の列またはフィルタリングされた行への制御されたアクセスを提供します。"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"論理ビューの作成","__idx":3},"children":["論理ビューの作成"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["論理ビューは、Data WorkbenchクエリエディタでSQL CREATE VIEWステートメントを使用して作成します。"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"trino-sqlを使用する","__idx":4},"children":["Trino SQLを使用する"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"sql","header":{"controls":{"copy":{}}},"source":"CREATE VIEW view_name AS\nSELECT column1, column2\nFROM table_name\nWHERE condition;\n\n-- セキュリティモードを指定する場合\nCREATE VIEW view_name\nSECURITY DEFINER  -- または INVOKER\nAS\nSELECT * FROM table_name;\n","lang":"sql"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["詳細については、以下を参照してください: ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://trino.io/docs/423/sql/create-view.html"},"children":["Trino create view構文"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"例","__idx":5},"children":["例"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["列をフィルタリングするビューを作成:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"sql","header":{"controls":{"copy":{}}},"source":"CREATE VIEW region_without_comment AS\nSELECT r_regionkey, r_name, r_dummy, time\nFROM tpch_sf1.region;\n","lang":"sql"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["タイムスタンプ変換を含むビューを作成:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"sql","header":{"controls":{"copy":{}}},"source":"CREATE VIEW orders_with_timestamp AS\nSELECT\n  order_id,\n  customer_id,\n  FROM_UNIXTIME(order_time) AS order_timestamp,\n  amount\nFROM orders;\n","lang":"sql"},"children":[]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"info"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["論理ビューのクエリは、SQLステートメントを使用してのみ作成および更新できます。ただし、ビューの詳細（名前、説明、セキュリティモード）はData Workbench UIで編集できます。"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"論理ビューの表示とクエリ","__idx":6},"children":["論理ビューの表示とクエリ"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"論理ビューのリスト表示","__idx":7},"children":["論理ビューのリスト表示"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["UIでは、",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Data Workbench"]}," > ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Databases"]},"に移動し、データベースを選択します。論理ビューは、",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["view"]},"タイプインジケーターとともにテーブルリストに表示されます。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/logical-view-table-list.785cdfb96192c886ccf89a6ed90780e00d722da802c5fc0d82d4ceabe87acdb0.4c190181.png","alt":"テーブルリストの論理ビュー"},"children":[]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["SQLを使用する場合:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"sql","header":{"controls":{"copy":{}}},"source":"SELECT * FROM INFORMATION_SCHEMA.VIEWS;\n","lang":"sql"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"論理ビューのクエリ","__idx":8},"children":["論理ビューのクエリ"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Trinoを使用して、通常のテーブルと同じように論理ビューをクエリできます:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"sql","header":{"controls":{"copy":{}}},"source":"SELECT * FROM region_without_comment WHERE r_name = 'ASIA';\n\nSELECT * FROM customer_summary WHERE total_orders > 10;\n","lang":"sql"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"ビューの詳細","__idx":9},"children":["ビューの詳細"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["ビュー詳細ページには、以下が表示されます:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Details"]},": 名前、説明、最終更新日、セキュリティモード、オーナー、作成日、データベース"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Records"]},": プレビューデータ（",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Update Preview"]},"を選択すると最大40件のサンプルレコードを取得）"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Schema"]},": 列定義とクエリテキスト。ビューのスキーマで使用されるデータ型はテーブルとは異なることに注意してください。テーブルでは",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/ja/products/customer-data-platform/data-workbench/databases/td-native-data-types"},"children":["TDネイティブデータ型"]},"が使用されます。ビューでは、クエリエンジンのデータ型が使用されます（例: Trinoの場合は",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://trino.io/docs/423/language/types.html"},"children":["Trinoデータ型"]},"）。"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Dependencies"]},": このビューによって参照されるテーブルとビュー"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/logical-view-details.c4dadffa2a5456e8a28bb8f1661b99f4b1036f34e6ccfb8273229f65ac6a42f6.4c190181.png","alt":"論理ビュー詳細ページ"},"children":[]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Records"]},"タブでは、ビューのデータをプレビューできます。",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Update Preview"]},"を選択すると、最大40件のサンプルレコードを取得できます:"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/logical-view-preview.feb7fee1a60d573f253800cd9156232a781548cf894c373aa3699c2bfb6cc39f.4c190181.png","alt":"論理ビューのプレビュー"},"children":[]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"論理ビューの管理","__idx":10},"children":["論理ビューの管理"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"ビュー定義の更新","__idx":11},"children":["ビュー定義の更新"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["ビュー定義を更新するには、CREATE OR REPLACE VIEWステートメントを使用します:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"sql","header":{"controls":{"copy":{}}},"source":"CREATE OR REPLACE VIEW view_name AS\nSELECT new_column1, new_column2\nFROM table_name\nWHERE new_condition;\n","lang":"sql"},"children":[]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"warning"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["CREATE OR REPLACE VIEWを使用すると、ビュー定義は新しいクエリで完全に置き換えられます。以前のすべての列とロジックは削除されます。"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"セキュリティモードの更新","__idx":12},"children":["セキュリティモードの更新"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["セキュリティモードは、UIまたはSQLを使用して変更できます。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["UIを使用する場合:"]}]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","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":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["セキュリティモード"]},"で",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Definer"]},"または",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Invoker"]},"を選択します"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["オプションで",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["名前"]},"または",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["説明"]},"を更新します"]}]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["確認"]},"を選択します"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/logical-view-edit-details-dialog.e55c3c71ef4577f32e40badcd4c2eb9904ce516dcade6a1ff89fe06a9b57e635.4c190181.png","alt":"論理ビューの詳細を編集ダイアログ"},"children":[]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["SQLを使用する場合:"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["セキュリティモードをSQLで変更するには、新しいセキュリティモード指定でCREATE OR REPLACE VIEWを使用します:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"sql","header":{"controls":{"copy":{}}},"source":"-- INVOKERモードに変更\nCREATE OR REPLACE VIEW view_name\nSECURITY INVOKER\nAS\nSELECT * FROM table_name;\n\n-- DEFINERモードに変更\nCREATE OR REPLACE VIEW view_name\nSECURITY DEFINER\nAS\nSELECT * FROM table_name;\n","lang":"sql"},"children":[]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"info"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["CREATE OR REPLACE VIEWを使用する場合、完全なクエリ定義を再指定する必要があります。"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"論理ビューの削除","__idx":13},"children":["論理ビューの削除"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["論理ビューを削除するには、DROP VIEWステートメントを使用します:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"sql","header":{"controls":{"copy":{}}},"source":"DROP VIEW view_name;\n","lang":"sql"},"children":[]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"info"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["ビューを削除しても、基盤となるテーブルは削除されません。他のビューがこのビューを参照している場合、それらのビューはクエリ時に失敗します。"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"ビューのオーナーシップの委譲","__idx":14},"children":["ビューのオーナーシップの委譲"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["ビューのオーナーは、DEFINERセキュリティモードを使用する場合に重要です。クエリはオーナーの権限で実行されるためです。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["現在、オーナーシップはAPIを介してのみ変更できます。対象ユーザーは、データベースに対するFull Accessパーミッションを持っている必要があります。"]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"warning"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["ビューのオーナーが削除され、ビューがDEFINERモードを使用している場合、ビューは機能しなくなります。"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"パーミッション","__idx":15},"children":["パーミッション"]},{"$$mdtype":"Tag","name":"p","attributes":{},"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":"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":["Full Access"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["✓"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["✓"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["✓"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["✓"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["✓"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Manage Own"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["✓"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["✓"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["✓"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["✓"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["✓"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["General Access"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["✓"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["✓"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["✓"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["✓"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["✓"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Query-only"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["✓"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["✗"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["✗"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["✗"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["✓"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Import-only"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["✓"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["✗"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["✗"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["✗"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["✗"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["None"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["✗"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["✗"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["✗"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["✗"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["✗"]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"セキュリティモードとパーミッション","__idx":16},"children":["セキュリティモードとパーミッション"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/ja/products/customer-data-platform/data-workbench/databases/logical-view-security-modes"},"children":["セキュリティモード"]},"は、参照されるテーブルへのアクセスに使用される権限を決定します。"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["DEFINERモード"]},"（デフォルト）: ビューオーナーの権限を使用します",{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["クエリ実行者は基盤となるテーブルへの権限が不要です"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["機密データへの制御されたアクセスを提供するのに便利です"]}]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["INVOKERモード"]},": クエリ実行者の権限を使用します",{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["クエリ実行者はすべての基盤となるテーブルへの権限が必要です"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["ユーザーレベルの権限を強制します"]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["詳細については、",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/ja/products/customer-data-platform/data-workbench/databases/logical-view-security-modes"},"children":["論理ビューのセキュリティモード"]},"を参照してください。"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"制限事項","__idx":17},"children":["制限事項"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"容量制限","__idx":18},"children":["容量制限"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["データベースあたり最大50の論理ビュー"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["論理ビューあたり最大1,024列"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["ビュー定義クエリステートメントの最大サイズは256 KB"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["ネストされた論理ビューの最大レベルは10"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"機能制限","__idx":19},"children":["機能制限"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["読み取り専用"]},": DML操作（INSERT、UPDATE、DELETE）はサポートされていません"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Trinoのみ"]},": 現在Trinoのみがサポートされています。Hiveのサポートは将来のリリースで予定されています"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["クロスアカウントクエリなし"]},": Data Clean Roomで他のアカウントのテーブルを参照するためにビューを使用することはできません"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Parent Segment統合なし"]},": 論理ビューはParent Segmentのマスターテーブルまたは属性テーブルとして使用できません（将来のリリースでサポート予定）"]},{"$$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":"Heading","attributes":{"level":3,"id":"列パーミッションの制限","__idx":20},"children":["列パーミッションの制限"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["ユーザーが",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["except: false"]},"の列パーミッション（タグ付けされていない列を表示できない）を持っている場合、セキュリティモードに関係なく、クエリで論理ビューを使用できません。"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"ライフサイクルの独立性","__idx":21},"children":["ライフサイクルの独立性"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["ビューとその参照テーブルのライフサイクルは独立しています:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["参照テーブルはいつでも削除できます"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["参照テーブルが削除された場合、ビューに対するクエリは失敗します"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["ビュークエリは、作成時にクエリエンジンによって検証されます"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"クエリエンジンの互換性","__idx":22},"children":["クエリエンジンの互換性"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["現在、論理ビューはTrinoのみでサポートされています"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Hiveのサポートは将来のリリースで予定されています"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["ビュー名はデータベース内で一意である必要があります"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["クエリエンジンのバージョンがアップグレードされると、SQL構文が変更される場合があります。互換性のないSQL構文が使用されている場合、古いクエリエンジンバージョンで定義されたビューは新しいクエリエンジンバージョンで動作しない可能性があります。その場合、ビュー定義を最新のSQL構文で更新する必要があります。"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"ベストプラクティス","__idx":23},"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":["ネストの深さに注意"]},": ビューのネストを妥当なレベルに保ちます（制限は10レベル）"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["制御されたアクセスにはDEFINERモードを使用"]},": テーブルアクセスを付与せずに、Query-onlyユーザーが変換されたデータにアクセスできるようにします"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["依存関係を監視"]},": テーブルを削除する前に、どのビューがそれらを参照しているかを確認します"]}]}]},"headings":[{"value":"論理ビュー","id":"論理ビュー","depth":1},{"value":"メリットとユースケース","id":"メリットとユースケース","depth":2},{"value":"一般的なユースケース","id":"一般的なユースケース","depth":3},{"value":"論理ビューの作成","id":"論理ビューの作成","depth":2},{"value":"Trino SQLを使用する","id":"trino-sqlを使用する","depth":3},{"value":"例","id":"例","depth":3},{"value":"論理ビューの表示とクエリ","id":"論理ビューの表示とクエリ","depth":2},{"value":"論理ビューのリスト表示","id":"論理ビューのリスト表示","depth":3},{"value":"論理ビューのクエリ","id":"論理ビューのクエリ","depth":3},{"value":"ビューの詳細","id":"ビューの詳細","depth":3},{"value":"論理ビューの管理","id":"論理ビューの管理","depth":2},{"value":"ビュー定義の更新","id":"ビュー定義の更新","depth":3},{"value":"セキュリティモードの更新","id":"セキュリティモードの更新","depth":3},{"value":"論理ビューの削除","id":"論理ビューの削除","depth":3},{"value":"ビューのオーナーシップの委譲","id":"ビューのオーナーシップの委譲","depth":3},{"value":"パーミッション","id":"パーミッション","depth":2},{"value":"セキュリティモードとパーミッション","id":"セキュリティモードとパーミッション","depth":3},{"value":"制限事項","id":"制限事項","depth":2},{"value":"容量制限","id":"容量制限","depth":3},{"value":"機能制限","id":"機能制限","depth":3},{"value":"列パーミッションの制限","id":"列パーミッションの制限","depth":3},{"value":"ライフサイクルの独立性","id":"ライフサイクルの独立性","depth":3},{"value":"クエリエンジンの互換性","id":"クエリエンジンの互換性","depth":2},{"value":"ベストプラクティス","id":"ベストプラクティス","depth":2}],"frontmatter":{"seo":{"title":"論理ビュー"}},"lastModified":"2025-12-16T04:37:23.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/ja/products/customer-data-platform/data-workbench/databases/logical-views","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}