Re: Yet another fast GiST build
Ibrar Ahmed <ibrar.ahmad@gmail.com>
From: Ibrar Ahmed <ibrar.ahmad@gmail.com>
To: Andrey Borodin <x4mmm@yandex-team.ru>,
Heikki Linnakangas <hlinnaka@iki.fi>
Cc: Peter Geoghegan <pg@bowt.ie>, Tom Lane <tgl@sss.pgh.pa.us>, Justin Pryzby <pryzby@telsasoft.com>, Darafei Komяpa Praliaskouski <me@komzpa.net>, Pavel Borisov <pashkin.elfe@gmail.com>, Thomas Munro <thomas.munro@gmail.com>, Michael Paquier <michael@paquier.xyz>, Alexander Korotkov <a.korotkov@postgrespro.ru>, PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2021-03-08T14:41:16Z
Lists: pgsql-hackers
On Mon, Jan 18, 2021 at 3:52 AM Heikki Linnakangas <hlinnaka@iki.fi> wrote: > On 18/01/2021 00:35, Peter Geoghegan wrote: > > On Sun, Jan 17, 2021 at 12:50 PM Tom Lane <tgl@sss.pgh.pa.us> wrote: > >> I noticed that gist_page_items() thinks it can hold inter_call_data->rel > >> open across a series of calls. That's completely unsafe: the executor > >> might not run the call series to completion (see LIMIT), resulting in > >> relcache leak complaints. > > Fixed, thanks! I changed it to return a tuplestore. > > > It also has the potential to run into big problems should the user > > input a raw page image with an regclass-argument-incompatible tuple > > descriptor. Maybe that's okay (this is a tool for experts), but it > > certainly is a consideration. > > I'm not sure I understand. It's true that the raw page image can contain > data from a different index, or any garbage really. And the function > will behave badly if you do that. That's an accepted risk with > pageinspect functions, that's why they're superuser-only, although some > of them are more tolerant of corrupt pages than others. The > gist_page_items_bytea() variant doesn't try to parse the key data and is > less likely to crash on bad input. > > - Heikki > > > The patch (0001-Add-bool-column-for-LP_DEAF-flag-to-GiST-pageinspect.patch ) does not apply successfully and has multiple hanks failed. http://cfbot.cputube.org/patch_32_2824.log patching file contrib/pageinspect/gistfuncs.c Hunk #1 FAILED at 151. Hunk #2 FAILED at 175. Hunk #3 FAILED at 245. Hunk #4 FAILED at 271. ... Can we get a rebase? I am marking the patch "Waiting on Author" -- Ibrar Ahmed
Commits
-
Add sortsupport for gist_btree opclasses, for faster index builds.
- 9f984ba6d23d 14.0 landed
-
pageinspect: Fix relcache leak in gist_page_items().
- 04eb75e783ba 14.0 landed
-
Fix test failure with wal_level=minimal.
- 5abca4b1cd71 14.0 landed
-
Enhance nbtree index tuple deletion.
- d168b666823b 14.0 cited
-
Fix portability issues in the new gist pageinspect test.
- 6ecaaf810b8b 14.0 landed
-
Add functions to 'pageinspect' to inspect GiST indexes.
- 756ab29124d7 14.0 landed
-
Fix missing validation for the new GiST sortsupport functions.
- 6f0bc5e1daf0 14.0 landed
-
Fix compilation warning in xlog.c
- 0a3c864c3275 14.0 cited
-
Set right-links during sorted GiST index build.
- 265ea567852a 14.0 landed
-
Fix checksum calculation in the new sorting GiST build.
- c47a240fe6db 14.0 landed
-
Add support for building GiST index by sorting.
- 16fa9b2b30a3 14.0 landed