Re: SP-GiST failing to complete SP-GiST index build

From: Peter Geoghegan <pg(at)bowt(dot)ie>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Jonathan S(dot) Katz" <jkatz(at)postgresql(dot)org>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: SP-GiST failing to complete SP-GiST index build
Date: 2018-05-28 00:24:37
Message-ID: CAH2-Wzmp_QG+iS7v4jqa3KRwUSweN=jSEQJOzKi4SEnMiX2xfw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sun, May 27, 2018 at 5:10 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Instrumenting the test case suggests that getQuadrant pretty much always
> returns 1, resulting in a worst-case unbalanced SPGiST tree. I think this
> is related to the fact that the test case inserts the values in increasing
> order, so that new values are always greater than existing values in the
> index.

I suspected the same. It reminded me of the weird behavior that the
Postgres qsort() sometimes exhibits.

> SPGiST is unable to rebalance its tree on the fly, so it's pretty
> well screwed in this situation. It does finish eventually, but in about
> 50x longer than GiST. I imagine the index's query performance would be
> equally awful.

Can you think of some way of side-stepping the issue? It's unfortunate
that SP-GiST is potentially so sensitive to input order.

--
Peter Geoghegan

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message PG Bug reporting form 2018-05-28 00:30:21 BUG #15212: Default values in partition tables don't work as expected and allow NOT NULL violation
Previous Message Tom Lane 2018-05-28 00:10:03 Re: SP-GiST failing to complete SP-GiST index build