Re: commitfest.postgresql.org is no longer fit for purpose

2024-05-24 Thread Tomas Vondra
ing an in-person discussion about patches would be good, but I think we should split the meeting into much smaller groups for that, each looking at a different subset. And maybe it should be determined in advance, so that people can look at those patches in advance ... -- Tomas Vondra EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company

Re: Conflict Detection and Resolution

2024-05-24 Thread Tomas Vondra
xactly it interleaves)? > - > > Apart from the above three main operations and resolver configuration, > there are more conflict types like primary-key updates, multiple > unique constraints etc and some special scenarios to be considered. > Complete design details can be found in [1]. > > [1]: https://wiki.postgresql.org/wiki/Conflict_Detection_and_Resolution > Hmmm, not sure it's good to have a "complete" design on wiki, and only some subset posted to the mailing list. I haven't compared what the differences are, though. regards -- Tomas Vondra EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company

Re: commitfest.postgresql.org is no longer fit for purpose

2024-05-24 Thread Tomas Vondra
On 5/24/24 19:09, Tom Lane wrote: > Tomas Vondra writes: >> On 5/20/24 16:16, Robert Haas wrote: >>> On Sun, May 19, 2024 at 3:18 PM Tom Lane wrote: >>>> * Before starting this thread, Robert did a lot of very valuable >>>> review of some indi

Re: commitfest.postgresql.org is no longer fit for purpose

2024-05-24 Thread Tomas Vondra
l mostly adopt that. And if we could make that process more convenient by improving the CF app to support it, that'd be even better ... I'm mostly used to the mailing list idea, but with the volume it's a constant struggle to keep track of new patch versions that I wanted/promised to review, etc. The

Re: Reading timestamp values from Datums gives garbage values

2024-05-20 Thread Tomas Vondra
is probably the simplest solution. And it's the number of microseconds, so X/1e6 should give you the epoch. regards -- Tomas Vondra EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company

Re: allow sorted builds for btree_gist

2024-05-18 Thread Tomas Vondra
On 5/18/24 02:00, Paul A Jungwirth wrote: > On Fri, May 17, 2024 at 12:41 PM Tomas Vondra > wrote: >> I've been looking at GiST to see if there could be a good way to do >> parallel builds - and there might be, if the opclass supports sorted >> builds, because then we co

Re: pg_combinebackup does not detect missing files

2024-05-18 Thread Tomas Vondra
t; Perhaps more importantly, can you even verify data checksums before the recovery is completed? I don't think you can (pg_checksums certainly does not allow doing that). Because who knows in what shape you copied the block? regards -- Tomas Vondra EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company

Re: allow sorted builds for btree_gist

2024-05-18 Thread Tomas Vondra
On 5/18/24 08:51, Andrey M. Borodin wrote: > > >> On 18 May 2024, at 00:41, Tomas Vondra >> wrote: >> >> if the opclass supports sorted builds, because then we could >> parallelize the sort. > > Hi Tomas! > > Yup, I'd also be g

Re: commitfest.postgresql.org is no longer fit for purpose

2024-05-17 Thread Tomas Vondra
automated way" to track this, though. I'm not sure it's quite possible - reviews can have a lot of very different forms, and deciding what is or is not a review is pretty subjective. So it's not clear how would we quantify that. Not to mention I'm sure we'd promptly find ways to game that. regards -- Tomas Vondra EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company

allow sorted builds for btree_gist

2024-05-17 Thread Tomas Vondra
regards -- Tomas Vondra EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL CompanyFrom 011e6eee923a6f51668f3277f470d32922923d17 Mon Sep 17 00:00:00 2001 From: Tomas Vondra Date: Fri, 17 May 2024 20:36:08 +0200 Subject: [PATCH v20240517] allow sorted builds for btree_gist --- contrib/

Re: commitfest.postgresql.org is no longer fit for purpose

2024-05-17 Thread Tomas Vondra
those who is on this thread? Would you volunteer to summarize a status of 20 patches in July’s CF? 5 each week or so. One per day. > Not sure. For many patches it'll be trivial. And for a bunch it'll be very very time-consuming. regards -- Tomas Vondra EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company

Re: commitfest.postgresql.org is no longer fit for purpose

2024-05-17 Thread Tomas Vondra
does seem to me a part of the solution needs to be helping to get those patches reviewed. I don't know how to do that, but perhaps there's a way to encourage people to review more stuff, or review stuff from a wider range of contributors. Say by treating reviews more like proper contributions

Re: BitmapHeapScan streaming read user and prelim refactoring

2024-05-14 Thread Tomas Vondra
On 5/14/24 20:40, Melanie Plageman wrote: > On Tue, May 14, 2024 at 2:33 PM Tomas Vondra > wrote: >> >> On 5/14/24 19:42, Melanie Plageman wrote: >>> I've fixed this. I've also set enable_material off as I mentioned I >>> might in my earlier mail. >&

Re: BitmapHeapScan streaming read user and prelim refactoring

2024-05-14 Thread Tomas Vondra
Because how do you know the plan does not change for some other unexpected reason, possibly in the future? IMHO if the test requires a specific plan, it's better to do an actual "explain (rows off, costs off)" to check that. regards -- Tomas Vondra EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company

Re: Parallel CREATE INDEX for GIN indexes

2024-05-13 Thread Tomas Vondra
On 5/13/24 10:19, Andy Fan wrote: > > Tomas Vondra writes: > >> ... >> >> I don't understand the question. The blocks are distributed to workers >> by the parallel table scan, and it certainly does not do that block by >> block. But even it it did, that's

Re: BitmapHeapScan streaming read user and prelim refactoring

2024-05-11 Thread Tomas Vondra
On 5/10/24 21:48, Melanie Plageman wrote: > On Thu, May 2, 2024 at 5:37 PM Tomas Vondra > wrote: >> >> >> >> On 4/24/24 22:46, Melanie Plageman wrote: >>> On Tue, Apr 23, 2024 at 6:43 PM Tomas Vondra >>> wrote: >>>> >>>&

Re: Parallel CREATE INDEX for GIN indexes

2024-05-10 Thread Tomas Vondra
On 5/10/24 07:53, Andy Fan wrote: > > Tomas Vondra writes: > >>> I guess both of you are talking about worker process, if here are >>> something in my mind: >>> >>> *btbuild* also let the WORKER dump the tuples into Sharedsort struct >>> an

Re: Parallel CREATE INDEX for GIN indexes

2024-05-09 Thread Tomas Vondra
On 5/9/24 17:51, Matthias van de Meent wrote: > On Thu, 9 May 2024 at 15:13, Tomas Vondra > wrote: >> Let me explain the relevant part of the patch, and how I understand the >> improvement suggested by Matthias. The patch does the work in three phases: >> >> >

Re: Parallel CREATE INDEX for GIN indexes

2024-05-09 Thread Tomas Vondra
On 5/2/24 20:22, Tomas Vondra wrote: >> >>> For some of the opclasses it can regress (like the jsonb_path_ops). I >>> don't think that's a major issue. Or more precisely, I'm not surprised >>> by it. It'd be nice to be able to disable the parallel builds in these

Re: Parallel CREATE INDEX for GIN indexes

2024-05-09 Thread Tomas Vondra
build in the workers this is likely true, because the TID lists do not overlap (and thus not hurting the compressibility). That being said, I still see this more as an optimization than something required for the patch, and I don't think I'll have time to work on this anytime soon. The patch is not extremely complex, but it's not trivial either. But if someone wants to take a stab at extending tuplesort to allow this, I won't object ... regards -- Tomas Vondra EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company

Re: Parallel CREATE INDEX for GIN indexes

2024-05-09 Thread Tomas Vondra
On 5/9/24 12:14, Andy Fan wrote: > > Tomas Vondra writes: > >> 3) v20240502-0003-Remove-the-explicit-pg_qsort-in-workers.patch >> >> In 0002 the workers still do an explicit qsort() on the TID list before >> writing the data into the shared tuplesort. But we c

Re: BitmapHeapScan streaming read user and prelim refactoring

2024-05-02 Thread Tomas Vondra
On 4/24/24 22:46, Melanie Plageman wrote: > On Tue, Apr 23, 2024 at 6:43 PM Tomas Vondra > wrote: >> >> On 4/23/24 18:05, Melanie Plageman wrote: >>> The patch with a fix is attached. I put the test in >>> src/test/regress/sql/join.sql. It isn't the perfec

Re: BitmapHeapScan streaming read user and prelim refactoring

2024-05-02 Thread Tomas Vondra
he discussion and the patch this seems like the right fix to me. I agree. > Does the test added here aptly cover 04e72ed617be in terms its functionality? > AFAIK the test fails without the fix and works with it, so I believe it does cover the relevant functionality. regards --

Re: Parallel CREATE INDEX for GIN indexes

2024-05-02 Thread Tomas Vondra
On 5/2/24 19:12, Matthias van de Meent wrote: > On Thu, 2 May 2024 at 17:19, Tomas Vondra > wrote: >> >> Hi, >> >> In PG17 we shall have parallel CREATE INDEX for BRIN indexes, and back >> when working on that I was thinking how difficult would it

Re: BitmapHeapScan streaming read user and prelim refactoring

2024-04-23 Thread Tomas Vondra
On 4/23/24 18:05, Melanie Plageman wrote: > On Mon, Apr 22, 2024 at 1:01 PM Melanie Plageman > wrote: >> >> On Thu, Apr 18, 2024 at 5:39 AM Tomas Vondra >> wrote: >>> >>> On 4/18/24 09:10, Michael Paquier wrote: >>>> On Sun, Apr 07, 2024 a

Re: createdb compares strategy as case-sensitive

2024-04-21 Thread Tomas Vondra
On 4/21/24 17:10, Tom Lane wrote: > Tomas Vondra writes: >> On 4/21/24 00:19, Tom Lane wrote: >>> I'm not suggesting that this is an interesting security vulnerability, >>> because if you can control the arguments to createdb it's probably >>> game over lon

Re: createdb compares strategy as case-sensitive

2024-04-21 Thread Tomas Vondra
On 4/21/24 00:19, Tom Lane wrote: > Tomas Vondra writes: >> On 4/20/24 22:40, Tom Lane wrote: >>> Seems reasonable. The alternative could be to remove createdb.c's use >>> of fmtId() here, but I don't think that's actually better. > >> Why? It se

Re: createdb compares strategy as case-sensitive

2024-04-20 Thread Tomas Vondra
On 4/20/24 22:40, Tom Lane wrote: > Tomas Vondra writes: >> While doing some testing with createdb, I noticed it only accepts >> file_copy/wal_log as valid strategies, not FILE_COPY/WAL_LOG (which is >> what the docs say). The same thing applies to CREATE DATABASE. >

createdb compares strategy as case-sensitive

2024-04-20 Thread Tomas Vondra
this should do pg_strcasecmp() which is what we do for other string parameters nearby. Patch attached. This should be backpatched to 15, I think. regards -- Tomas Vondra EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL CompanyFrom 4f4eac5ed7547d27a789624a237bab1ab51b2e4b Mon

Re: brininsert optimization opportunity

2024-04-19 Thread Tomas Vondra
On 4/19/24 00:13, Tomas Vondra wrote: > ... > > It's a bit too late for me to push this now, I'll do so early tomorrow. > FWIW I've pushed both patches, which resolves the open item, so I've moved it to the "resolved" part on wiki. thanks -- Tomas Von

Re: brininsert optimization opportunity

2024-04-18 Thread Tomas Vondra
er tweaks an existing one). It's a bit too late for me to push this now, I'll do so early tomorrow. regards -- Tomas Vondra EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL CompanyFrom 0f89677b99b4b70ddfcc6c2cd08f433584bf65aa Mon Sep 17 00:00:00 2001 From: Tomas Vondra Date

Re: BitmapHeapScan streaming read user and prelim refactoring

2024-04-18 Thread Tomas Vondra
gt; forward here? AFAIK the plan is to replace the asserts with actually resetting the rs_empty_tuples_pending field to 0, as suggested by Melanie a week ago. I assume she was busy with the post-freeze AM reworks last week, so this was on a back burner. regards -- Tomas Vondra EnterpriseDB: htt

Re: brininsert optimization opportunity

2024-04-18 Thread Tomas Vondra
//www.postgresql.org/message-id/202401091043.e3nrqiad6gb7@alvherre.pgsql regards -- Tomas Vondra EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company

Re: Parallel CREATE INDEX for BRIN indexes

2024-04-17 Thread Tomas Vondra
On 4/15/24 20:35, Tomas Vondra wrote: > ... > > Attached is the cleanup I thought about doing earlier in this patch [1] > to make the code more like btree. The diff might make it seem like a big > change, but it really just moves the merge code into a separate function > and

Re: Parallel CREATE INDEX for BRIN indexes

2024-04-17 Thread Tomas Vondra
On 4/16/24 22:33, Tomas Vondra wrote: > On 4/15/24 20:35, Tomas Vondra wrote: >> On 4/15/24 10:18, Tomas Vondra wrote: > > ... > > That is, no parallel index builds on temporary tables. Which means the > test is not actually testing anything :-( Much more stable, but not v

Re: Parallel CREATE INDEX for BRIN indexes

2024-04-16 Thread Tomas Vondra
On 4/15/24 20:35, Tomas Vondra wrote: > On 4/15/24 10:18, Tomas Vondra wrote: >> ... >> >> I'll try a bit more to make this work without the temp table. >> > > Considering the earlier discussion in e2933a6e1, I think making the > table TEMP is the best fix, so

Re: Parallel CREATE INDEX for BRIN indexes

2024-04-15 Thread Tomas Vondra
On 4/15/24 10:18, Tomas Vondra wrote: > ... > > I'll try a bit more to make this work without the temp table. > Considering the earlier discussion in e2933a6e1, I think making the table TEMP is the best fix, so I'll do that. Thanks for remembering that change, Alexander! Attached is

Re: Parallel CREATE INDEX for BRIN indexes

2024-04-15 Thread Tomas Vondra
On 4/15/24 08:00, Alexander LAW wrote: > Hello Tomas, > > 14.04.2024 20:09, Tomas Vondra wrote: >> I've pushed this, including backpatching the two fixes. I've reduced the >> amount of data needed by the test, and made sure it works on 32-bits too >> (I was a bit wo

Re: Parallel CREATE INDEX for BRIN indexes

2024-04-14 Thread Tomas Vondra
between the BTREE and BRIN code for parallel builds, I mentioned in [1]. That's more of a cosmetic issue, but I'll add it as an open item for myself. regards [1] https://www.postgresql.org/message-id/3733d042-71e1-6ae6-5fac-00c12db62db6%40enterprisedb.com -- Tomas Vondra EnterpriseDB: http

Re: Parallel CREATE INDEX for BRIN indexes

2024-04-13 Thread Tomas Vondra
On 4/13/24 11:19, Tomas Vondra wrote: > On 4/13/24 10:36, Andres Freund wrote: >> Hi, >> >> While preparing a differential code coverage report between 16 and HEAD, one >> thing that stands out is the parallel brin build code. Neither on >> coverage.postgresql.org

Re: Why is parula failing?

2024-04-13 Thread Tomas Vondra
oops of "make check" without a single failure. So either parula has packages in a different way, or maybe it's a more of a timing issue and rpi5 is way slower than graviton3. regards -- Tomas Vondra EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company

Re: Why is parula failing?

2024-04-13 Thread Tomas Vondra
n the failures on the other branches. > I can't think of a reason why the erroneous reltuples=48 would be > consistent over 2 failing runs if it were failing RAM or a cosmic ray. > Yeah, that seems very unlikely. regards -- Tomas Vondra EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company

Re: post-freeze damage control

2024-04-13 Thread Tomas Vondra
On 4/13/24 01:23, David Steele wrote: > On 4/12/24 22:27, Tomas Vondra wrote: >> >> >> On 4/12/24 08:42, David Steele wrote: >>> On 4/11/24 20:26, Tomas Vondra wrote: >>>> On 4/11/24 03:52, David Steele wrote: >>>>> On 4/11/24 10:23, To

Re: post-freeze damage control

2024-04-13 Thread Tomas Vondra
On 4/13/24 01:03, David Steele wrote: > On 4/12/24 22:12, Tomas Vondra wrote: >> On 4/11/24 23:48, David Steele wrote: >>> On 4/11/24 20:26, Tomas Vondra wrote: >>> >>>> FWIW that discussion also mentions stuff that I think the feature >>>&g

Re: Parallel CREATE INDEX for BRIN indexes

2024-04-13 Thread Tomas Vondra
hanks for pointing this out, it's definitely something that I need to improve (admittedly, should have been part of the patch). I'll also look into eliminating the difference between BTREE and BRIN parallel builds, mentioned in my last message in this thread. regards -- Tomas Vondra

Re: Add notes to pg_combinebackup docs

2024-04-12 Thread Tomas Vondra
On 4/12/24 11:12, Magnus Hagander wrote: > On Tue, Apr 9, 2024 at 11:46 AM Tomas Vondra > wrote: > >> >> >> On 4/9/24 09:59, Martín Marqués wrote: >>> Hello, >>> >>> While doing some work/research on the new incremental backup feature &g

Re: Add notes to pg_combinebackup docs

2024-04-12 Thread Tomas Vondra
them using e.g. "ratarmount" and then use that as source directories for pg_combinebackup. It's not entirely friction-less because AFAICS it's necessary to do the backup in plain format and then do the .tar to have the expected "flat" directory structure (and not manifest + 2x t

Re: post-freeze damage control

2024-04-12 Thread Tomas Vondra
On 4/12/24 08:42, David Steele wrote: > On 4/11/24 20:26, Tomas Vondra wrote: >> On 4/11/24 03:52, David Steele wrote: >>> On 4/11/24 10:23, Tom Kincaid wrote: >>>> >>>> The extensive Beta process we have can be used to build confidence we >&g

Re: post-freeze damage control

2024-04-12 Thread Tomas Vondra
On 4/11/24 23:48, David Steele wrote: > On 4/11/24 20:26, Tomas Vondra wrote: >> >> On 4/11/24 03:52, David Steele wrote: >>> On 4/11/24 10:23, Tom Kincaid wrote: >>>> >>>> The extensive Beta process we have can be used to build confidence we

Re: Add notes to pg_combinebackup docs

2024-04-11 Thread Tomas Vondra
On 4/11/24 02:01, David Steele wrote: > On 4/9/24 19:44, Tomas Vondra wrote: >> >> On 4/9/24 09:59, Martín Marqués wrote: >>> Hello, >>> >>> While doing some work/research on the new incremental backup feature >>> some limit

Re: post-freeze damage control

2024-04-11 Thread Tomas Vondra
kup solution that'd manage backup registry, retention, etc. > Also, there are outstanding issues here [3] and now here [4]. > I agree with some of this, I'll respond in the threads. regards Tomas -- Tomas Vondra EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company

Re: post-freeze damage control

2024-04-09 Thread Tomas Vondra
On 4/9/24 01:33, Michael Paquier wrote: > On Tue, Apr 09, 2024 at 01:16:02AM +0200, Tomas Vondra wrote: >> I don't feel too particularly worried about this. Yes, backups are super >> important because it's often the only thing you have left when things go >> wrong, and t

Re: PostgreSQL 17 Release Management Team & Feature Freeze

2024-04-09 Thread Tomas Vondra
On 4/9/24 11:25, Matthias van de Meent wrote: > On Mon, 8 Apr 2024 at 20:15, Tomas Vondra > wrote: >> >> >> On 4/8/24 17:48, Matthias van de Meent wrote: >>> On Mon, 8 Apr 2024 at 17:21, Tomas Vondra >>> wrote: >>>> >>>>

Re: Add notes to pg_combinebackup docs

2024-04-09 Thread Tomas Vondra
g before combining the backups is not very convenient. Reading and writing the tar would make this simpler. > Around the same time, Tomas Vondra tested incremental backups with a > cluster where he enabled checksums after taking the previous full > backup. After combining the backups the

Re: post-freeze damage control

2024-04-08 Thread Tomas Vondra
plex workloads etc. and I'll let keep doing that for a while. Maybe I'm a bit too happy-go-lucky, but IMO the risk here is limited. regards -- Tomas Vondra EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company

Re: PostgreSQL 17 Release Management Team & Feature Freeze

2024-04-08 Thread Tomas Vondra
On 4/8/24 21:32, Jelte Fennema-Nio wrote: > On Mon, 8 Apr 2024 at 20:15, Tomas Vondra > wrote: >> I 100% understand how frustrating the lack of progress can be, and I >> agree we need to do better. I tried to move a number of stuck patches >> this CF, and I ho

Re: PostgreSQL 17 Release Management Team & Feature Freeze

2024-04-08 Thread Tomas Vondra
On 4/8/24 17:48, Matthias van de Meent wrote: > On Mon, 8 Apr 2024 at 17:21, Tomas Vondra > wrote: >> >> ... >> >> For me the main problem with the pre-freeze crush is that it leaves >> pretty much no practical chance to do meaningful review/testing, an

Re: PostgreSQL 17 Release Management Team & Feature Freeze

2024-04-08 Thread Tomas Vondra
t think so. (It anything, it does not seem fair to expect others to do last-minute reviews under pressure.) Maybe it'd be better to start by expanding the existing rule about not committing patches introduced for the first time in the last CF. What if we said that patches in the last CF must

Re: Add bump memory context type and use it for tuplesorts

2024-04-07 Thread Tomas Vondra
On 4/7/24 23:09, Andres Freund wrote: > Hi, > > On 2024-04-07 22:35:47 +0200, Tomas Vondra wrote: >> I haven't investigated, but I'd considering it works on 64-bit, I guess >> it's not considering alignment somewhere. I can dig more if needed. > > I think I may t

Re: Add bump memory context type and use it for tuplesorts

2024-04-07 Thread Tomas Vondra
On 4/7/24 22:35, Tomas Vondra wrote: > On 4/7/24 14:37, David Rowley wrote: >> On Sun, 7 Apr 2024 at 22:05, John Naylor wrote: >>> >>> On Sat, Apr 6, 2024 at 7:37 PM David Rowley wrote: >>>> >>> I'm planning on pushing these, pending a final

Re: Add bump memory context type and use it for tuplesorts

2024-04-07 Thread Tomas Vondra
works on 64-bit, I guess it's not considering alignment somewhere. I can dig more if needed. regards -- Tomas Vondra EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Companywarning: Can't open file /SYSV003414ed (deleted) during file-backed mapping note processing [New LW

Re: pg_combinebackup --copy-file-range

2024-04-07 Thread Tomas Vondra
On 4/7/24 19:46, Tomas Vondra wrote: > On 4/5/24 21:43, Tomas Vondra wrote: >> Hi, >> >> ... >> >> 2) The prefetching is not a huge improvement, at least not for these >> three filesystems (btrfs, ext4, xfs). From the color scale it might seem >>

Re: BitmapHeapScan streaming read user and prelim refactoring

2024-04-07 Thread Tomas Vondra
On 4/7/24 16:24, Melanie Plageman wrote: > On Sun, Apr 7, 2024 at 7:38 AM Tomas Vondra > wrote: >> >> >> >> On 4/7/24 06:17, Melanie Plageman wrote: >>> On Sun, Apr 07, 2024 at 02:27:43AM +0200, Tomas Vondra wrote: >>>> On 4/6/24 23:34

Re: BitmapHeapScan streaming read user and prelim refactoring

2024-04-07 Thread Tomas Vondra
On 4/7/24 15:11, Melanie Plageman wrote: > On Sun, Apr 7, 2024 at 7:38 AM Tomas Vondra > wrote: >> >> On 4/7/24 06:17, Melanie Plageman wrote: >>>> What bothers me on 0006-0008 is that the justification in the commit >>>> messages is "future commi

Re: BitmapHeapScan streaming read user and prelim refactoring

2024-04-07 Thread Tomas Vondra
On 4/7/24 06:17, Melanie Plageman wrote: > On Sun, Apr 07, 2024 at 02:27:43AM +0200, Tomas Vondra wrote: >> On 4/6/24 23:34, Melanie Plageman wrote: >>> ... >>>> >>>> I realized it makes more sense to add a FIXME (I used XXX. I'm not when >>

Re: BitmapHeapScan streaming read user and prelim refactoring

2024-04-06 Thread Tomas Vondra
m did not use the iterator, what if some other AM uses it? Without 0012 it'd be a problem for the AM, no? Would it make sense to move 0009 before these three patches? That seems like a meaningful change on it's own, right? FWIW I don't think it's very likely I'll commit the UnifiedTBMIterator stuff

Re: BitmapHeapScan streaming read user and prelim refactoring

2024-04-06 Thread Tomas Vondra
On 4/6/24 15:40, Melanie Plageman wrote: > On Sat, Apr 06, 2024 at 02:51:45AM +0200, Tomas Vondra wrote: >> >> >> On 4/6/24 01:53, Melanie Plageman wrote: >>> On Fri, Apr 05, 2024 at 04:06:34AM -0400, Melanie Plageman wrote: >>>> On Thu, Apr 04, 20

Re: BitmapHeapScan streaming read user and prelim refactoring

2024-04-06 Thread Tomas Vondra
On 4/6/24 02:51, Tomas Vondra wrote: > > * The one question I'm somewhat unsure about is why Tom chose to use the > "wrong" recheck flag in the 2017 commit, when the correct recheck flag > is readily available. Surely that had a reason, right? But I can't think >

Re: BitmapHeapScan streaming read user and prelim refactoring

2024-04-05 Thread Tomas Vondra
On 4/6/24 01:53, Melanie Plageman wrote: > On Fri, Apr 05, 2024 at 04:06:34AM -0400, Melanie Plageman wrote: >> On Thu, Apr 04, 2024 at 04:35:45PM +0200, Tomas Vondra wrote: >>> >>> >>> On 4/4/24 00:57, Melanie Plageman wrote: >>>> On Sun, Mar 31,

Re: incremental backup breakage in BlockRefTableEntryGetBlocks

2024-04-04 Thread Tomas Vondra
On 4/4/24 19:38, Robert Haas wrote: > Hi, > > Yesterday, Tomas Vondra reported to me off-list that he was seeing > what appeared to be data corruption after taking and restoring an > incremental backup. Overnight, Jakub Wartak further experimented with > Tomas's test case

Re: pg_combinebackup --copy-file-range

2024-04-04 Thread Tomas Vondra
On 4/4/24 12:25, Jakub Wartak wrote: > On Thu, Apr 4, 2024 at 12:56 AM Tomas Vondra > wrote: >> >> Hi, >> >> Here's a much more polished and cleaned up version of the patches, >> fixing all the issues I've been aware of, and with various parts merged >&

Re: pg_combinebackup --copy-file-range

2024-04-03 Thread Tomas Vondra
think the performance is an issue - everything has a cost. On 4/3/24 15:39, Jakub Wartak wrote: > On Mon, Apr 1, 2024 at 9:46 PM Tomas Vondra > wrote: >> >> Hi, >> >> I've been running some benchmarks and experimenting with various stuff, >> trying to

Re: using extended statistics to improve join estimates

2024-04-02 Thread Tomas Vondra
ch, and I think it can be committed > individually if you are OK with that. > > Hope this kind of review is helpful. > Cool! There's obviously no chance to get this into v18, and I have stuff to do in this CF. But I'll take a look after that. regards -- Tomas Vondra EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company

Re: pg_combinebackup --copy-file-range

2024-04-02 Thread Tomas Vondra
But maybe not, and I'd say an implementation that is this difficult to configure is almost as if it didn't exist at all. The linux read-ahead works by default pretty great. So I don't see how to make this work without explicit prefetch ... Of course, we could also do no prefetch and tell users it's up to ZFS to make this work, but I don't think it does them any service. regards -- Tomas Vondra EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company

Re: pg_combinebackup --copy-file-range

2024-03-30 Thread Tomas Vondra
On 3/31/24 06:46, Thomas Munro wrote: > On Sun, Mar 31, 2024 at 5:33 PM Tomas Vondra > wrote: >> I'm on 2.2.2 (on Linux). But there's something wrong, because the >> pg_combinebackup that took ~150s on xfs/btrfs, takes ~900s on ZFS. >> >> I'm not sure it's a ZFS

Re: pg_combinebackup --copy-file-range

2024-03-30 Thread Tomas Vondra
On 3/31/24 03:03, Thomas Munro wrote: > On Sun, Mar 31, 2024 at 1:37 PM Tomas Vondra > wrote: >> So I decided to take a stab at Thomas' idea, i.e. reading the data to >> ... >> I'll see how this works on EXT4/ZFS next ... > > Wow, very cool! A couple of very

Re: BitmapHeapScan streaming read user and prelim refactoring

2024-03-29 Thread Tomas Vondra
ink the regular RA (in linux kernel) works for ZFS, right? I was wondering if we could use this (posix_fadvise) to improve that, essentially by issuing fadvise even for sequential patterns. But now that I think about that, if posix_fadvise works since 2.2, maybe RA works too now?) regards -- Tomas Vondra EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company

Re: BitmapHeapScan streaming read user and prelim refactoring

2024-03-29 Thread Tomas Vondra
On 3/29/24 23:03, Thomas Munro wrote: > On Sat, Mar 30, 2024 at 10:39 AM Thomas Munro wrote: >> On Sat, Mar 30, 2024 at 4:53 AM Tomas Vondra >> wrote: >>> ... Maybe there should be some flag to force >>> issuing fadvise even for sequential patterns, pe

Re: BitmapHeapScan streaming read user and prelim refactoring

2024-03-29 Thread Tomas Vondra
On 3/29/24 02:12, Thomas Munro wrote: > On Fri, Mar 29, 2024 at 10:43 AM Tomas Vondra > wrote: >> I think there's some sort of bug, triggering this assert in heapam >> >> Assert(BufferGetBlockNumber(hscan->rs_cbuf) == tbmres->blockno); > > Thanks for t

Re: incorrect results and different plan with 2 very similar queries

2024-03-28 Thread Tomas Vondra
ey might try a couple things: 1) set enable_nestloop=off, see if the results get correct 2) try bt_index_check on i_39773, might notice some corruption 3) rebuild the index If it's not this, they'll need to build a reproducer. It's really difficult to deduce what's going on just from query plans for different parameter values. regards -- Tomas Vondra EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company

Re: pg_upgrade --copy-file-range

2024-03-28 Thread Tomas Vondra
On 3/28/24 21:45, Robert Haas wrote: > On Tue, Mar 26, 2024 at 2:09 PM Tomas Vondra > wrote: >> The patch I shared a couple minutes ago should fix this, effectively >> restoring the original debug behavior. I liked the approach with calling >> strategy_implementat

Re: BitmapHeapScan streaming read user and prelim refactoring

2024-03-28 Thread Tomas Vondra
On 3/27/24 20:37, Melanie Plageman wrote: > On Mon, Mar 25, 2024 at 12:07:09PM -0400, Melanie Plageman wrote: >> On Sun, Mar 24, 2024 at 06:37:20PM -0400, Melanie Plageman wrote: >>> On Sun, Mar 24, 2024 at 5:59 PM Tomas Vondra >>> wrote: >>>

Re: BitmapHeapScan streaming read user and prelim refactoring

2024-03-28 Thread Tomas Vondra
to the gap). But with the combine limit set to 32, is this still true? I've tried going through read_stream_* to determine how this will behave, but read_stream_look_ahead/read_stream_start_pending_read does not make this very clear. I'll have to experiment with some tracing. regards --

Re: To what extent should tests rely on VACUUM ANALYZE?

2024-03-28 Thread Tomas Vondra
* numbers, and it should be exactly the same for all the analyze runs. So how come it changes like this? regards -- Tomas Vondra EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company

Re: speed up a logical replica setup

2024-03-26 Thread Tomas Vondra
On 3/26/24 21:17, Euler Taveira wrote: > On Tue, Mar 26, 2024, at 4:12 PM, Tomas Vondra wrote: >> Perhaps I'm missing something, but why is NUM_CONN_ATTEMPTS even needed? >> Why isn't recovery_timeout enough to decide if wait_for_end_recovery() >> waited long enough? &

Re: speed up a logical replica setup

2024-03-26 Thread Tomas Vondra
;> One possible approach is to wait until the replication starts. Alternative >> one is >> to ease the condition. > > That's my suggestion too. I reused NUM_CONN_ATTEMPTS (that was renamed to > NUM_ATTEMPTS in the first patch). See second patch. > Perhaps I'm missing something, but why is NUM_CONN_ATTEMPTS even needed? Why isn't recovery_timeout enough to decide if wait_for_end_recovery() waited long enough? IMHO the test should simply pass PG_TEST_DEFAULT_TIMEOUT when calling pg_createsubscriber, and that should do the trick. Increasing PG_TEST_DEFAULT_TIMEOUT is what buildfarm animals doing things like ubsan/valgrind already use to deal with exactly this kind of timeout problem. Or is there a deeper problem with deciding if the system is in recovery? regards -- Tomas Vondra EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company

Re: pg_upgrade --copy-file-range

2024-03-26 Thread Tomas Vondra
On 3/25/24 15:31, Robert Haas wrote: > On Sat, Mar 23, 2024 at 9:37 AM Tomas Vondra > wrote: >> OK, that makes sense. Here's a patch that should work like this - in >> copy_file we check if we need to calculate checksums, and either use the >> requested copy method, o

Re: pg_combinebackup --copy-file-range

2024-03-26 Thread Tomas Vondra
On 3/26/24 15:09, Jakub Wartak wrote: > On Sat, Mar 23, 2024 at 6:57 PM Tomas Vondra > wrote: > >> On 3/23/24 14:47, Tomas Vondra wrote: >>> On 3/23/24 13:38, Robert Haas wrote: >>>> On Fri, Mar 22, 2024 at 8:26 PM Thomas Munro >>>> wrote: >

Re: Add bump memory context type and use it for tuplesorts

2024-03-25 Thread Tomas Vondra
at idea, makes the code more complex, and I don't quite see how is that better or easier to use than having a separate BumpContext ... Having an AllocSet that mixes chunks that may be freed and chunks that can't be freed, and have a different context type in the chunk header, seems somewhat confusing and "not great" for debugging, for example. regards -- Tomas Vondra EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company

Re: BitmapHeapScan streaming read user and prelim refactoring

2024-03-24 Thread Tomas Vondra
On 3/24/24 21:12, Melanie Plageman wrote: > On Sun, Mar 24, 2024 at 2:22 PM Tomas Vondra > wrote: >> >> On 3/24/24 18:38, Melanie Plageman wrote: >>> I haven't had a chance yet to reproduce the regressions you saw in the >>> streaming read user patch or to loo

Re: BitmapHeapScan streaming read user and prelim refactoring

2024-03-24 Thread Tomas Vondra
On 3/24/24 18:38, Melanie Plageman wrote: > On Sun, Mar 24, 2024 at 01:36:19PM +0100, Tomas Vondra wrote: >> >> >> On 3/23/24 01:26, Melanie Plageman wrote: >>> On Fri, Mar 22, 2024 at 08:22:11PM -0400, Melanie Plageman wrote: >>>> On Tue, Mar 19, 20

Re: BitmapHeapScan streaming read user and prelim refactoring

2024-03-24 Thread Tomas Vondra
h v8, but unfortunately it crashes for me very quickly (I've only seen 0015 to crash, so I guess the bug is in that patch). The backtrace attached, this doesn't seem right: (gdb) p hscan->rs_cindex $1 = 543516018 regards -- Tomas Vondra EnterpriseDB: http://www.enterprisedb.com

Re: pg_upgrade --copy-file-range

2024-03-23 Thread Tomas Vondra
On 3/23/24 14:47, Tomas Vondra wrote: > On 3/23/24 13:38, Robert Haas wrote: >> On Fri, Mar 22, 2024 at 8:26 PM Thomas Munro wrote: >>> Hmm, this discussion seems to assume that we only use >>> copy_file_range() to copy/clone whole segment files, right? That's >

Re: pg_upgrade --copy-file-range

2024-03-23 Thread Tomas Vondra
y_file_range, depending on checksums and what was requested. BTW is there a reason why the code calls "write" and not "pg_pwrite"? regards -- Tomas Vondra EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company

Re: pg_upgrade --copy-file-range

2024-03-23 Thread Tomas Vondra
On 3/22/24 19:40, Robert Haas wrote: > On Fri, Mar 22, 2024 at 1:22 PM Tomas Vondra > wrote: >> Right, this will happen: >> >> pg_combinebackup: error: unable to use accelerated copy when manifest >> checksums are to be calculated. Use --no-manifest >&

Re: Large block sizes support in Linux

2024-03-22 Thread Tomas Vondra
mean, how would the administrator *know* it's safe to set full_page_writes=off, or even better how could we verify this when the database starts (and complain if it's not safe to disable FPW)? It's easy to e.g. take a backup on one filesystem and restore it on another one, and forget t

Re: pg_upgrade --copy-file-range

2024-03-22 Thread Tomas Vondra
On 3/22/24 17:42, Robert Haas wrote: > On Fri, Mar 22, 2024 at 10:40 AM Tomas Vondra > wrote: >> There's one question, though. As it stands, there's a bit of asymmetry >> between handling CopyFile() on WIN32 and the clone/copy_file_range on >> other platforms). On WIN32,

Re: pg_upgrade --copy-file-range

2024-03-22 Thread Tomas Vondra
on a range of platforms. One open question is how to allow testing this. For pg_upgrade we now have PG_TEST_PG_UPGRADE_MODE, which can be set to e.g. "--clone". I wonder if we should add PG_TEST_PG_COMBINEBACKUP_MODE ... regards -- Tomas Vondra EnterpriseDB: http://www.enterprisedb.com The E

Re: BitmapHeapScan streaming read user and prelim refactoring

2024-03-20 Thread Tomas Vondra
estigated this, but it seems to get broken by this patch: v7-0009-Make-table_scan_bitmap_next_block-async-friendly.patch I wonder if there are some additional changes aside from the rebase. regards -- Tomas Vondra EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company

Re: BitmapHeapScan streaming read user and prelim refactoring

2024-03-19 Thread Tomas Vondra
On 3/18/24 16:55, Tomas Vondra wrote: > > ... > > OK, I've restarted the tests for only 0012 and 0014 patches, and I'll > wait for these to complete - I don't want to be looking for patterns > until we have enough data to smooth this out. > > I now have results for 1M

  1   2   3   4   5   6   7   8   9   10   >