Re: GiST "choose subtree" support function to inline penalty

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Darafei "Komяpa" Praliaskouski <me(at)komzpa(dot)net>
Cc: PostgreSQL Developers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: GiST "choose subtree" support function to inline penalty
Date: 2019-06-27 03:00:51
Message-ID: 26036.1561604451@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

=?UTF-8?Q?Darafei_=22Kom=D1=8Fpa=22_Praliaskouski?= <me(at)komzpa(dot)net> writes:
> I'm looking at PostGIS geometry GiST index build times and try to optimize
> withing the current GiST framework. The function that shows a lot on my
> flame graphs is penalty.

> I spent weekend rewriting PostGIS penalty to be as fast as possible.
> (FYI https://github.com/postgis/postgis/pull/425/files)

> However I cannot get any meaningfully faster build time. Even when I strip
> it to "just return edge extension" index build time is the same.

TBH this makes me wonder whether the real problem isn't so much "penalty
function is too slow" as "penalty function is resulting in really bad
index splits".

It might be that giving the opclass higher-level control over the split
decision can help with both aspects. But never start micro-optimizing
an algorithm until you're sure it's the right algorithm.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message AminPG Jaffer 2019-06-27 03:49:08 Cost and execution plan
Previous Message yuzuko 2019-06-27 02:34:13 Re: Problem with default partition pruning