Database Index
データベースインデックス
データベースのインデックスは、選択された検索、ソート、またはルールを高速化するための追加データ構造です。ストレージを使用し、データが変更されると追加の作業が発生します。
もう一つの例
サポートシステムはしばしば `tenant_id`、`status`、および `updated_at DESC` でオープンチケットを見つけます。エクスプレインプランは、1つの複合部分インデックスによりp95が780msから24msに減少することを示しています。`status`単独のインデックスは、見つかる行が多すぎて書き込みコストが増えるため、却下されます。
主な部分
- 01インデックス化されたキー
- 02インデックス構造と述語
- 03プランナーアクセスパス
以下の場合に使用します
測定検索、結合、ソート、一意ルール、または外部キーのパターン用のインデックスを追加してください。実際のデータと実行計画で確認してください。
以下の場合は使用しないでください
すべての列をインデックス化したり、追加書き込みやメモリを無視したりしないでください。インデックスが使われていると仮定せず、実行計画を確認してください。
コードで使用する名前
CREATE INDEX with column order, method, predicate, and measured query plan 出荷前に
Check contracts and invariants, authorization, and input limits. Test retries, one-time effects, timeouts, and partial failures. Verify data integrity, compatibility, monitoring, recovery, and rollback.
Outcome:Complete the task with データベースインデックス (Database Index)。 User context:サポートシステムはしばしば `tenant_id`、`status`、および `updated_at DESC` でオープンチケットを見つけます。エクスプレインプランは、1つの複合部分インデックスによりp95が780msから24msに減少することを示しています。`status`単独のインデックスは、見つかる行が多すぎて書き込みコストが増えるため、却下されます。 Technical concept or control:データベースインデックス (Database Index)。 Why it fits:測定検索、結合、ソート、一意ルール、または外部キーのパターン用のインデックスを追加してください。実際のデータと実行計画で確認してください。 Do not use it when:すべての列をインデックス化したり、追加書き込みやメモリを無視したりしないでください。インデックスが使われていると仮定せず、実行計画を確認してください。 Engineering requirements: Define inputs, outputs, contracts, and rules that must always hold. Set authorization and input checks. Define failures, timeouts, retries, one-time effects, data moves, and compatibility limits. Operations: Add useful signals and logs that hide sensitive data. Set capacity limits and write an operator guide. Test recovery and rollback. Acceptance criteria: Contract and failure-path tests pass. Data and authorization rules still hold during retries and partial failures. Check performance limits, monitoring, recovery, and rollback. Evidence and limits (evidence boundary):その情報源にとって公式です。他のプラットフォームやチームはその用語を別の方法で使用する場合があります。 Unknowns to confirm: Where the code runs, data stores, traffic shape, consistency needs, and the security boundary. Also confirm the compatibility period, service goals, and rollback limits.
このリクエストを確認する
Review how データベースインデックス (Database Index) is used now. Definition: データベースのインデックスは、選択された検索、ソート、またはルールを高速化するための追加データ構造です。ストレージを使用し、データが変更されると追加の作業が発生します。 Release checks: Check contracts and invariants, authorization, and input limits. Test retries, one-time effects, timeouts, and partial failures. Verify data integrity, compatibility, monitoring, recovery, and rollback. Before changing code, list the evidence, gaps, severity, and the smallest safe fix.