Re: Should pg 11 use a lot more memory building an spgist index?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Amit Langote <Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp>
Cc: Bruno Wolff III <bruno(at)wolff(dot)to>, pgsql-general(at)lists(dot)postgresql(dot)org, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Should pg 11 use a lot more memory building an spgist index?
Date: 2018-10-26 10:20:13
Message-ID: 25756.1540549213@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

Amit Langote <Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp> writes:
> On 2018/10/26 18:59, Tom Lane wrote:
>> After a quick look around, I think that making systable_begin/endscan
>> do this is a nonstarter; there are just too many call sites that would
>> be affected. Now, you could imagine specifying that indexes on system
>> catalogs (in practice, only btree) have to clean up at endscan time
>> but other index types don't, so that only operations that might be
>> scanning user indexes need to have suitable wrapping contexts. Not sure
>> there's a lot of benefit to that, though.

> By "core code", I didn't mean systable_being/endscan, but rather
> check_exclusion_or_unique_constraint() or its core-side caller(s).

Well, we'd need to consider any call path leading to index_endscan.
One of those is systable_endscan and its multitude of callers. It seems
unlikely that you could just switch context in systable_beginscan
without breaking many of the callers.

If we forbade leaks in system catalog index AMs, then the number of
places that would need work would be manageable (about 3, it looked
like). But then it seems more like a wart than a real API improvement.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Олег Самойлов 2018-10-26 11:04:07 Re: Strange behavior of the random() function
Previous Message Amit Langote 2018-10-26 10:08:44 Re: Should pg 11 use a lot more memory building an spgist index?

Browse pgsql-hackers by date

  From Date Subject
Next Message Surafel Temesgen 2018-10-26 10:28:31 FETCH FIRST clause WITH TIES option
Previous Message Dagfinn Ilmari =?utf-8?Q?Manns=C3=A5ker?= 2018-10-26 10:15:19 Re: [PATCH] Tab complete EXECUTE FUNCTION for CREATE (EVENT) TRIGGER