MAX(UPPER(range)) can't be accelerated with a GiST index on the range?
Any index can only be used for WHERE conditions of the form

&lt;indexed expression&gt; &lt;operator&gt; &lt;constant&gt;

Here &lt;operator&gt; must be of an operator class supported by the index, and &lt;constant&gt; must be constant for the duration of the index scan.

Other than that, indexes can speed up the following (where the first two are only possible with B-tree indexes):


max(&lt;indexed expression&gt;) and min(&lt;indexed expression&gt;)
ORDER BY &lt;indexed expression&gt;
functions returning boolean in the WHERE condition, if they have a support function.