Partial index

Partial index

A partial index is a database index which has some condition applied to it such that it only includes a portion of the rows in the table. In SQL Server, this type of index is called a Filtered Index.

This can allow the index to remain small even though the table may be rather large, and have fairly 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.

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;

External links

* [http://db.cs.berkeley.edu/papers/ERL-M89-17.pdf The Case For Partial Indexes]


Wikimedia Foundation. 2010.

Игры ⚽ Нужен реферат?

Look at other dictionaries:

  • Partial re-configuration — is the process of configuring a portion of a field programmable gate array while the other part is still running/operating.Hardware, like software, can be designed modularly, by creating subcomponents and then higher level components to… …   Wikipedia

  • partial — I (biased) adjective bigoted, cupidus, discriminatory, favorably disposed, inclined, influenced, iniquus, interested, jaundiced, narrow minded, one sided, partisan, predisposed, prejudiced, prepossessed, prone, restricted, studiosus, subjective,… …   Law dictionary

  • partial change — index modification Burton s Legal Thesaurus. William C. Burton. 2006 …   Law dictionary

  • partial excuse — index extenuating circumstances Burton s Legal Thesaurus. William C. Burton. 2006 …   Law dictionary

  • partial ism — index favoritism Burton s Legal Thesaurus. William C. Burton. 2006 …   Law dictionary

  • partial payment — index installment Burton s Legal Thesaurus. William C. Burton. 2006 …   Law dictionary

  • partial similarity — index analogy Burton s Legal Thesaurus. William C. Burton. 2006 …   Law dictionary

  • partial to — index inclined, willing (desirous) Burton s Legal Thesaurus. William C. Burton. 2006 …   Law dictionary

  • partial truth — index evasion Burton s Legal Thesaurus. William C. Burton. 2006 …   Law dictionary

  • Index set (recursion theory) — In the field of recursion theory, index sets describe classes of partial recursive functions, specifically they give all indices of functions in that class according to a fixed enumeration of partial recursive functions (a Gödel… …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”