According to this Boundless link, it turns out that in PostGIS, spatial query on table with spatial index uses two pass system: with the first pass approximates spatial relationship with bounding box.
Now i was wondering if such approach will be effective for a PostGIS table with geometry type "ST_POINT", as bounding box of a point IS essentially the point itself.
With this in mind, I run an ST_INTERSECT query by Jmeter to 2 tables with exactly the same set of points, and exactly the same intersect BOX. The only difference is one table has spatial index and the other don't.
The result surprises me: the one with spatial index performed much faster.
In my machine, the average response times are:
- with spatial index: 911 ms
- without spatial index: 62038 ms
Now the question: why does spatial index still matter for a table with only points?