About: Partial index

An Entity of Type: work, from Named Graph: http://dbpedia.org, within Data Space: dbpedia.org

In databases, a partial index, also known as filtered index is an index which has some condition applied to it so that it includes a subset of rows in the table. This allows the index to remain small, even though the table may be rather large, and have extreme selectivity. Suppose you have a transaction table where entries start out with STATUS = 'A' (active), and then may pass through other statuses ('P' for pending, 'W' for "being worked on") before reaching a final status, 'F', at which point it is no longer likely to be processed again.

Property Value
dbo:abstract
  • In databases, a partial index, also known as filtered index is an index which has some condition applied to it so that it includes a subset of rows in the table. This allows the index to remain small, even though the table may be rather large, and have extreme selectivity. Suppose you have a transaction table where entries start out with STATUS = 'A' (active), and then may pass through other statuses ('P' for pending, 'W' for "being worked on") before reaching a final status, 'F', at which point it is no longer likely to be processed again. In PostgreSQL, a useful partial index might be defined as: create index partial_status on txn_table (status) where status in ('A', 'P', 'W'); This index would not bother storing any of the millions of rows that have reached "final" status, 'F', and would allow queries looking for transactions that still "need work" to efficiently search via this index. Similarly, a partial index can be used to index only those rows where a column is not null, which will be of benefit when the column usually is null. create index partial_object_update on object_table (updated_on) where updated_on is not null; This index would allow the following query to read only the updated tuples: select * from object_table where updated_on is not null order by updated_on; It is not necessary that the condition be the same as the index criterion; Stonebraker's paper below presents a number of examples with indexes similar to the following: create index partial_salary on employee(age) where salary > 2100; (en)
  • 部分インデックス(ぶぶんインデックス、英: partial index)は関係データベース管理システムで用いられるインデックスの中で、特定の条件に適合する行だけを含むものを指す。 インデックスの対象となるテーブルに多くの行が含まれていても、インデックスに含むキーを絞り込むことで、インデックスのサイズを小さく抑えられる利点がある。 処理状況をフラグ列として持つテーブルを例に挙げる。フラグには 'A' (アクティブ), 'P' (処理待ち), 'W' (処理中), 'F' (完了) があるとする。インデックスを使った検索が必要なのは 'A', 'P', 'W' のみである場合、以下のような部分インデックスを定義することができる。 CREATE INDEX partial_flag ON txn_table (flag) WHERE flag in ('A', 'P', 'W'); このインデックスは フラグが 'F' の行を含まない。行の大半の処理が完了していると考えられるならば、フラグ 'F' の行を除外することでインデックスが含む行数を少なく抑えながら、検索できる必要のある行に対しては依然としてインデックスを使うことができる。 同様に、部分インデックスは、特定の列が NULL でない行だけを含むように定義することもできる。大半の行のその列が NULL であるならば大きな利益が見込める。 CREATE INDEX partial_object_update ON object_table (updated_on) WHERE updated_on IS NOT NULL; このインデックスを使って以下のクエリを実行すると、更新日を持つ (updated_on IS NOT NULL) 行を効率良く取得できる。 SELECT * FROM object_table WHERE updated_on IS NOT NULL ORDER BY updated_on; 部分インデックスの条件は、キーと異なる列でも良い。以下のようなインデックスも定義できる。 CREATE INDEX partial_salary ON employee(age) WHERE salary > 2100; (ja)
dbo:wikiPageExternalLink
dbo:wikiPageID
  • 2558484 (xsd:integer)
dbo:wikiPageLength
  • 3079 (xsd:nonNegativeInteger)
dbo:wikiPageRevisionID
  • 1111324085 (xsd:integer)
dbo:wikiPageWikiLink
dbp:wikiPageUsesTemplate
dcterms:subject
gold:hypernym
rdf:type
rdfs:comment
  • In databases, a partial index, also known as filtered index is an index which has some condition applied to it so that it includes a subset of rows in the table. This allows the index to remain small, even though the table may be rather large, and have extreme selectivity. Suppose you have a transaction table where entries start out with STATUS = 'A' (active), and then may pass through other statuses ('P' for pending, 'W' for "being worked on") before reaching a final status, 'F', at which point it is no longer likely to be processed again. (en)
  • 部分インデックス(ぶぶんインデックス、英: partial index)は関係データベース管理システムで用いられるインデックスの中で、特定の条件に適合する行だけを含むものを指す。 インデックスの対象となるテーブルに多くの行が含まれていても、インデックスに含むキーを絞り込むことで、インデックスのサイズを小さく抑えられる利点がある。 処理状況をフラグ列として持つテーブルを例に挙げる。フラグには 'A' (アクティブ), 'P' (処理待ち), 'W' (処理中), 'F' (完了) があるとする。インデックスを使った検索が必要なのは 'A', 'P', 'W' のみである場合、以下のような部分インデックスを定義することができる。 CREATE INDEX partial_flag ON txn_table (flag) WHERE flag in ('A', 'P', 'W'); このインデックスは フラグが 'F' の行を含まない。行の大半の処理が完了していると考えられるならば、フラグ 'F' の行を除外することでインデックスが含む行数を少なく抑えながら、検索できる必要のある行に対しては依然としてインデックスを使うことができる。 同様に、部分インデックスは、特定の列が NULL でない行だけを含むように定義することもできる。大半の行のその列が NULL であるならば大きな利益が見込める。 (ja)
rdfs:label
  • 部分インデックス (ja)
  • Partial index (en)
owl:sameAs
prov:wasDerivedFrom
foaf:isPrimaryTopicOf
is dbo:wikiPageRedirects of
is dbo:wikiPageWikiLink of
is foaf:primaryTopic of
Powered by OpenLink Virtuoso    This material is Open Knowledge     W3C Semantic Web Technology     This material is Open Knowledge    Valid XHTML + RDFa
This content was extracted from Wikipedia and is licensed under the Creative Commons Attribution-ShareAlike 3.0 Unported License