# データの鮮度 Sigma がデータの鮮度を処理する方法について説明します。 Sigma では、[Stripe API](https://docs.stripe.com/api.md) からアクセスできる同じ基礎データを分析できますが、カスタムクエリと分析には SQL ベースのインターフェイスを使用します。Data Pipeline のデータ鮮度については、[Data Pipeline のデータ鮮度](https://docs.stripe.com/stripe-data/data-pipeline/data-freshness.md)をご覧ください。 さらに、Sigma は、[レポート](https://docs.stripe.com/stripe-reports.md)など、Stripe API では利用できない特定のデータへのアクセスを提供します。 ## データの鮮度 Sigma は、取引データのほとんどを 1 日以内にクエリで利用できるようにします。 Sigmaは、Stripe取引データの大半を3時間以内にクエリできるようにします。すべてのAPIアクティビティは、発生から約3時間後にクエリ可能になります。たとえば、午前12:00(UTC)のデータは、同日の午前3:00(UTC)までに利用可能になります。 ### クエリデータの読み込み時間 ダッシュボードのインターフェイスには、最後の決済データの日時が表示されます。クエリの値として `data_load_time` を使用すると、アカウントでデータが最後に処理された日時を表すことができます。たとえば、決済テーブルが最後に更新されたのが 2026/4/5 の場合、`data_load_time` は `2026-04-02 00:00:00 +0000` と解釈されます。場合により、Sigma は `data_load_time` よりも最近のアクティビティーを反映していることがあります。たとえば、午前 0 時直前にオーソリされ、その直後にキャプチャーされた支払いが、キャプチャー済みと表示される場合があります。 データを使用できるようにするには、さらに時間が必要です。`data_load_time` は、ご利用のアカウントで最後にデータが処理された日付を表すクエリの値として使用できます。この値を使用して、スケジュール済みのクエリの日付の範囲を動的に設定します。 たとえば、`data_load_time` の 1 カ月前に作成された取引残高のリストを返す以下のスケジュール済みのクエリについて考えてみます。 ```sql select id, amount, fee, currency from balance_transactions -- this table is the canonical record of changes to your Stripe balance where created < data_load_time and created >= data_load_time - interval '1' month order by created desc limit 10 ``` 次のタイムラインは、データの可用性に基づいてこれがどのように機能するかを表します。 | 日付 | 結果のタイムライン | | ---------- | ----------------------------------------------------------------------------------------------------------------------------------------- | | 2026-04-02 | - `data_load_time` は `2026-04-02` として解釈されます - スケジュール済みのクエリには、2026-04-01 の終わりまでの取引データが含まれます - クエリ結果は、2026-04-02 の 2pm UTC までに利用可能になります | 次に、`data_load_time` の 1 カ月前に作成された各手数料の残高引き落としに関連付けられた charge_ids とインターチェンジ請求額のリストを返す、以下のスケジュール済みのクエリについて考えます。 ```sql select ic.charge_id, ic.billing_currency, ic.billing_amount, ic.balance_transaction_id, ic.balance_transaction_created_at from icplus_fees as ic join balance_transactions as bt on ic.balance_transaction_id = bt.id where bt.created >= data_load_time - interval '1' month and bt.created < data_load_time ``` このクエリが毎日反復的に実行されるようにスケジュールされている場合、結果を取得できるタイミングは、次のタイムラインのようになります。 | 日付 | 結果のタイムライン | | ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | | 2026-04-05 | - `data_load_time` は `2026-04-02 00:00:00 +0000` として解釈されます - スケジュール済みのクエリには、2026-04-01 の終わりまでの取引データが含まれます - クエリ結果は、2026-04-05 の 2am UTC までに利用可能になります | ## データセットの鮮度 #### API ベースのデータ | データセット | テーブル名 | 鮮度 (時間) | | ------------ | ----------------------------------------------- | ------- | | billing | クーポン | 3 | | billing | coupons_currency_options | 3 | | billing | coupons_metadata | 3 | | billing | credit_note_discount_amounts | 3 | | billing | credit_note_line_item_discount_amounts | 3 | | billing | credit_note_line_item_tax_amounts | 3 | | billing | credit_note_line_items | 3 | | billing | credit_note_tax_amounts | 3 | | billing | credit_notes | 3 | | billing | credit_notes_metadata | 3 | | billing | discounts | 3 | | billing | invoice_custom_fields | 3 | | billing | invoice_customer_tax_ids | 3 | | billing | invoice_items | 3 | | billing | invoice_items_metadata | 3 | | billing | invoice_line_item_discount_amounts | 3 | | billing | invoice_line_item_tax_amounts | 3 | | billing | invoice_line_items | 3 | | billing | invoice_payments | 3 | | billing | invoice_shipping_cost_taxes | 3 | | billing | 請求書 | 3 | | billing | invoices_metadata | 3 | | billing | plans | 3 | | billing | plans_metadata | 3 | | billing | price_tiers | 3 | | billing | 料金 | 3 | | billing | prices_currency_options | 3 | | billing | prices_metadata | 3 | | billing | 商品 | 3 | | billing | products_metadata | 3 | | billing | promotion_codes | 3 | | billing | 見積もり | 3 | | billing | subscription_items | 3 | | billing | subscription_items_metadata | 3 | | billing | subscription_schedule_phase_add_invoice_items | 3 | | billing | subscription_schedule_phase_configuration_items | 3 | | billing | subscription_schedule_phases | 3 | | billing | subscription_schedule_phases_metadata | 3 | | billing | subscription_schedules | 3 | | billing | subscription_schedules_metadata | 3 | | billing | サブスクリプション | 3 | | billing | subscriptions_metadata | 3 | | billing | tax_rates | 3 | | billing | tax_rates_metadata | 3 | | billing | usage_records | 3 | | 決済 | checkout_custom_fields | 3 | | 決済 | checkout_line_items | 3 | | 決済 | checkout_sessions | 3 | | 決済 | payment_links | 3 | | connect | 口座 | 3 | | connect | accounts_metadata | 3 | | connect-fees | application_fee_refunds | 3 | | connect-fees | application_fee_refunds_metadata | 3 | | connect-fees | application_fees | 3 | | 暗号資産 | crypto_onramp_sessions | 3 | | 顧客 | customer_balance_transactions | 3 | | 顧客 | customer_balance_transactions_metadata | 3 | | 顧客 | customer_cash_balance_transactions | 3 | | 顧客 | customer_tax_ids | 3 | | 顧客 | 顧客 | 3 | | 顧客 | customers_metadata | 3 | | issuing | issuing_authorizations | 3 | | issuing | issuing_authorizations_metadata | 3 | | issuing | issuing_cardholders | 3 | | issuing | issuing_cardholders_metadata | 3 | | issuing | issuing_cards | 3 | | issuing | issuing_cards_metadata | 3 | | issuing | issuing_disputes | 3 | | issuing | issuing_network_tokens | 3 | | issuing | issuing_transactions | 3 | | issuing | issuing_transactions_metadata | 3 | | 決済 | balance_transaction_fee_details | 3 | | 決済 | balance_transactions | 3 | | 決済 | 支払い | 3 | | 決済 | charges_metadata | 3 | | 決済 | 不審請求申請 | 3 | | 決済 | disputes_enhanced_eligibility | 3 | | 決済 | disputes_metadata | 3 | | 決済 | payment_intents | 3 | | 決済 | payment_intents_metadata | 3 | | 決済 | payment_method_details | 3 | | 決済 | payment_methods | 3 | | 決済 | payment_methods_metadata | 3 | | 決済 | payment_reviews | 3 | | 決済 | 返金 | 3 | | 決済 | refunds_metadata | 3 | | 決済 | rule_decisions | 3 | | 決済 | setup_attempts | 3 | | 決済 | setup_intents | 3 | | 決済 | setup_intents_metadata | 3 | | 決済 | sources | 3 | | 決済 | sources_metadata | 3 | #### 派生データ | データセット | テーブル名 | 鮮度 (時間) | | ------------- | ------------------------------------------------- | ------- | | 分析 | aggregate_optimization_details | 24 | | 分析 | analytics_acceptance_itemized | 24 | | 分析 | authentication_report_attempts | 72 | | 分析 | charge_optimization_details | 72 | | billing | recoveries | 48 | | billing | subscription_item_change_events | 24 | | billing | subscription_item_change_events_v2_beta (Preview) | 3 | | billing | subscription_item_change_events_testmode | 48 | | キャピタル | financing_balances | 24 | | キャピタル | financing_offers | 24 | | キャピタル | financing_transactions | 24 | | コスト | network_cost_insights_report | 120 | | Radar | card_testing | 120 | | Radar | radar_data_integration | 48 | | Radar | radar_rule_attributes | 48 | | Radar | radar_rules | 24 | | 税金 | tax_transaction_jurisdiction_details | 24 | | 税金 | tax_transaction_line_items | 24 | | 税金 | tax_transaction_line_items_metadata | 24 | | 税金 | tax_transaction_shipping_costs | 24 | | 税金 | tax_transactions | 24 | | 税金 | tax_transactions_metadata | 24 | | tax-reporting | tax_forms | 24 | | ターミナル | terminal_hardware_order_items | 24 | | ターミナル | terminal_hardware_order_metadata | 24 | | ターミナル | terminal_hardware_order_shipment_tracking | 24 | | ターミナル | terminal_hardware_order_tax_amounts | 24 | | ターミナル | terminal_hardware_orders | 24 | | ターミナル | terminal_locations | 120 | | ターミナル | terminal_readers | 120 | | 送金 | transfer_reversals | 24 | | 送金 | transfer_reversals_metadata | 24 | | 送金 | 送金 | 24 | | 送金 | transfers_metadata | 24 | | 財務 | treasury_financial_accounts | 24 | | 財務 | treasury_financial_accounts_metadata | 24 | | 財務 | treasury_inbound_transfers | 24 | | 財務 | treasury_inbound_transfers_metadata | 24 | | 財務 | treasury_outbound_payments | 24 | | 財務 | treasury_outbound_payments_metadata | 24 | | 財務 | treasury_outbound_transfers | 24 | | 財務 | treasury_outbound_transfers_metadata | 24 | | 財務 | treasury_transaction_entries | 24 | | 財務 | treasury_transactions | 24 | | 他 | acceptance_reporting_v3_itemized | 68 | | 他 | activity_report_itemized | 80 | | 他 | cau_fees | 72 | | 他 | charge_groups | 72 | | 他 | connected_account_activity_report_itemized | 80 | | 他 | connected_account_itemized_fees | 120 | | 他 | connected_account_itemized_fees_beta | 120 | | 他 | connected_account_summarized_balance_transactions | 12 | | 他 | exchange_rates_from_usd | 24 | | 他 | icplus_fees | 72 | | 他 | itemized_fees | 120 | | 他 | itemized_fees_beta | 120 | | 他 | revenue_recognition_debits_and_credits | 3 | | 他 | summarized_balance_transactions | 12 | ## データスキーマ API 規則に厳密に従った完全な [スキーマ](https://docs.stripe.com/stripe-data/schema.md)を、テーブル関係性の詳細を示す分割ビュー形式で表示することができます。クエリで使用できるすべてのデータが、カテゴリー別に整理されて表示されます。各カテゴリーには、使用可能なデータを表す一連のテーブルが含まれています。多くのテーブルは、特定の API オブジェクトに対応しており、各列は報告された属性を表します。たとえば、`charges` テーブルは、[Charge](https://docs.stripe.com/api.md#charge_object)オブジェクトに関する情報を表示します。また、ダッシュボードの**支払い**セクションに表示されます。 テーブルを選択して展開し、利用可能な列とそれに含まれるデータ型の説明を表示できます (`Boolean`、`Varchar`、`Foreign key` など)。任意の列の上にカーソルを合わせると、その説明が表示されます。スキーマの上部に表示される検索フィールドを使用して、特定のテーブルと列を検索します。クエリを作成する際は、[API リファレンス](https://docs.stripe.com/api.md) で追加のコンテキストと値を参照してください。