Re: Minmax indexes - Mailing list pgsql-hackers

From Heikki Linnakangas
Subject Re: Minmax indexes
Date
Msg-id 5236D78D.7000701@vmware.com
Whole thread Raw
In response to Minmax indexes  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Responses Re: Minmax indexes
List pgsql-hackers
On 15.09.2013 03:14, Alvaro Herrera wrote:
> + Partial indexes are not supported; since an index is concerned with minimum and
> + maximum values of the involved columns across all the pages in the table, it
> + doesn't make sense to exclude values.  Another way to see "partial" indexes
> + here would be those that only considered some pages in the table instead of all
> + of them; but this would be difficult to implement and manage and, most likely,
> + pointless.

Something like this seems completely sensible to me:

create index i_accounts on accounts using minmax (ts) where valid = true;

The situation where that would be useful is if 'valid' accounts are 
fairly well clustered, but invalid ones are scattered all over the 
table. The minimum and maximum stoed in the index would only concern 
valid accounts.

- Heikki



pgsql-hackers by date:

Previous
From: wangshuo@highgo.com.cn
Date:
Subject: Re: Re: [HACKERS] Is it necessaryto rewrite table while increasing the scale of datatype numeric?
Next
From: Andres Freund
Date:
Subject: Re: patch: add MAP_HUGETLB to mmap() where supported (WIP)