Does spgist extension in PostgreSQL 9.2.3 support float or int array? SP-GiST is an abbreviation for space-partitioned GiST in PostgreSQL 9.2.3. It can be used to find the similar tuple by creating the sp-gist index on the column.

e.g:

create index pt_spgist_idx on geo using spgist(point);


'Point' column on table 'Geo' is Point type of Geometric Types. 

and we can use sql sentence to find the nearest point of (34.34898,-92.82934) with spgist index 'pt_spgist_idx':

select point from geo where point ~= '(34.34898,-92.82934)'


We can see that sp-gist index supports Geometric Point type.

The question is:

Does spgist extension in PostgreSQL 9.2.3 support float or int array? For I want to use sp-gist index in int array whose size is 500.
No, by default SP-GiST only supports these operators over point ranges box and text

Name            Indexed Data Type   Indexable Operators
kd_point_ops    point               &lt;&lt; &lt;@ &lt;^ &gt;&gt; &gt;^ ~=
quad_point_ops  point               &lt;&lt; &lt;@ &lt;^ &gt;&gt; &gt;^ ~=
range_ops       any range type      &amp;&amp; &amp;&lt; &amp;&gt; -|- &lt;&lt; &lt;@ = &gt;&gt; @&gt;
box_ops         box                 &lt;&lt; &amp;&lt; &amp;&amp; &amp;&gt; &gt;&gt; ~= @&gt; &lt;@ &amp;&lt;| &lt;&lt;| |&gt;&gt; |&amp;&gt;
text_ops        text                &lt; &lt;= = &gt; &gt;= ~&lt;=~ ~&lt;~ ~&gt;=~ ~&gt;~


That's not to say that it can not work over float or int[] but it may be awkward unless they have any special internal designation you can exploit for partitioning. That is to say, if your int[] and array are likely to produce balanced trees, or are equally distributed there is no point whatsoever (afaik).