Re: Commit fest 2025-03

2025-03-09 Thread vignesh C
On Wed, 5 Mar 2025 at 16:50, Jim Jones wrote: > > Hi Vignesh > > On 05.03.25 10:22, vignesh C wrote: > > The following "Ready for committer" patches needs rebase > > --- > > Truncate logs by max_log_size - Kirill Gavrilov > > > > Patch owners, please provide a r

Re: MergeJoin beats HashJoin in the case of multiple hash clauses

2025-03-09 Thread Alexander Korotkov
On Wed, Mar 5, 2025 at 4:43 AM Alexander Korotkov wrote: > > On Mon, Mar 3, 2025 at 10:24 AM Andrei Lepikhov wrote: > > On 17/2/2025 01:34, Alexander Korotkov wrote: > > > Hi, Andrei! > > > > > > On Tue, Oct 8, 2024 at 8:00 AM Andrei Lepikhov wrote: > > > Thank you for your work on this subject.

Re: Considering fractional paths in Append node

2025-03-09 Thread Nikita Malakhov
Hi! No objections. Alexander, thank you! -- Nikita Malakhov Postgres Professional The Russian Postgres Company https://postgrespro.ru/

Re: Incorrect assert in libpqwalreceiver

2025-03-09 Thread Heikki Linnakangas
On 09/03/2025 10:09, Jacob Brazeal wrote: The libpqrcv_connect function asserts 'Assert(i < sizeof(keys))', where keys is declared as const char *keys[6];. However, sizeof(keys) is not the correct way to check the array length (on my system, for example, it's 48 = 6 * 8 at this callsite, not 6

Re: Printing window function OVER clauses in EXPLAIN

2025-03-09 Thread Tom Lane
=?utf-8?Q?=C3=81lvaro?= Herrera writes: > Would it be possible and make sense to use notation of explicit WINDOW > clauses, for cases where multiple window functions invoke identical > window definitions? There's something to be said for that. We would have to assign made-up names to windows tha

Re: Parallel CREATE INDEX for GIN indexes

2025-03-09 Thread Tom Lane
Tomas Vondra writes: > I pushed the two smaller parts today. Coverity is a little unhappy about this business in _gin_begin_parallel: boolleaderparticipates = true; ... #ifdef DISABLE_LEADER_PARTICIPATION leaderparticipates = false; #endif ...

Re: Statistics Import and Export

2025-03-09 Thread Jeff Davis
On Sat, 2025-03-08 at 10:56 -0500, Robert Treat wrote: > In the UX world, the general pattern is people start to get > overwhelmed once you get over a 1/2 dozen options (I think that's > based on Miller's law, but might be mis-remembering); we are already > at 9 for this use case. So really it is q

Re: Enhance file_fdw to report processed and skipped tuples in COPY progress

2025-03-09 Thread vignesh C
On Wed, 5 Mar 2025 at 21:43, Fujii Masao wrote: > > > > On 2024/11/30 15:23, Kirill Reshke wrote: > > On Fri, 11 Oct 2024 at 06:53, Fujii Masao > > wrote: > >> However, this issue already exists without the proposed patch. > >> Since file_fdw already reports progress partially, querying multiple

Re: Introduce new multi insert Table AM and improve performance of various SQL commands with it for Heap AM

2025-03-09 Thread Daniil Davydov
Hi, A few days ago I came up with an idea to implement multi insert optimization wherever possible. I prepared a raw patch and it showed a great performance gain (up to 4 times during INSERT ... INTO ... in the best case). Then I was very happy to find this thread. You did a great job and I want to

Re: Considering fractional paths in Append node

2025-03-09 Thread Alexander Korotkov
On Wed, Mar 5, 2025 at 1:20 PM Alexander Korotkov wrote: > On Wed, Mar 5, 2025 at 8:32 AM Andrei Lepikhov wrote: > > On 5/3/2025 03:27, Alexander Korotkov wrote: > > > On Mon, Mar 3, 2025 at 1:04 PM Andrei Lepikhov wrote: > > >>> 2. As usage of root->tuple_fraction RelOptInfo it has been critici

Re: [Doc] Improve hostssl related descriptions and option presentation

2025-03-09 Thread vignesh C
On Fri, 28 Feb 2025 at 00:08, David G. Johnston wrote: > > On Mon, Apr 22, 2024 at 2:20 PM David G. Johnston > wrote: >> >> Thoughts anyone? >> >> On Thu, Feb 1, 2024 at 3:47 PM David G. Johnston >> wrote: >>> >>> Motivated by a recent complaint [1] I found the hostssl related material in >>>

Re: general purpose array_sort

2025-03-09 Thread jian he
hi. patch rebased, also did some minor comments tweak. From c9398dfe889f23dce147db1719aa9fe4dfaa3adc Mon Sep 17 00:00:00 2001 From: jian he Date: Sun, 9 Mar 2025 20:45:20 +0800 Subject: [PATCH v16 1/2] general purpose array_sort Introduce the SQL-callable function array_sort(anyarray). The param

Re: Printing window function OVER clauses in EXPLAIN

2025-03-09 Thread Álvaro Herrera
Hello Would it be possible and make sense to use notation of explicit WINDOW clauses, for cases where multiple window functions invoke identical window definitions? I'm thinking of something like explain verbose SELECT empno, depname, row_number() OVER testwin rn, rank() OVER tes

Re: strange valgrind reports about wrapper_handler on 64-bit arm

2025-03-09 Thread Tomas Vondra
On 3/9/25 03:16, Nathan Bossart wrote: > On Sat, Mar 08, 2025 at 11:48:22PM +0100, Tomas Vondra wrote: >> Shortly after restarting this I got three more reports - all of them are >> related to strcoll_l. This is on c472a18296e4, i.e. with the asserts >> added in this thread etc. But none of those s

Re: BackgroundPsql swallowing errors on windows

2025-03-09 Thread Noah Misch
On Sun, Mar 09, 2025 at 12:47:34PM -0400, Andres Freund wrote: > On 2025-02-16 17:52:36 -0800, Noah Misch wrote: > > On Sun, Feb 16, 2025 at 08:42:50PM -0500, Andres Freund wrote: > > > On February 16, 2025 7:50:18 PM EST, Tom Lane wrote: > > > >Noah Misch writes: > > > >> On Sun, Feb 16, 2025 at

Re: what's going on with lapwing?

2025-03-09 Thread Robert Haas
On Thu, Mar 6, 2025 at 12:22 PM Tom Lane wrote: > I don't think that's the way to think about old buildfarm members. > Sure, nobody is very likely to be putting PG 18 on a Debian 7 box, > but the odds are much higher that they might have PG 13 on it and > wish to update to 13.latest. So what you

Incorrect assert in libpqwalreceiver

2025-03-09 Thread Jacob Brazeal
Hello hackers, The libpqrcv_connect function asserts 'Assert(i < sizeof(keys))', where keys is declared as const char *keys[6];. However, sizeof(keys) is not the correct way to check the array length (on my system, for example, it's 48 = 6 * 8 at this callsite, not 6.) I attached a patch to fix

Re: Commit fest 2025-03

2025-03-09 Thread vignesh C
On Thu, 6 Mar 2025 at 21:24, Tom Lane wrote: > > vignesh C writes: > > On Wed, 5 Mar 2025 at 16:50, Jim Jones wrote: > >> Is there something wrong with the commitfest app? This patch applies > >> cleanly and passes all tests > > > I verified that it applies neatly and passes the tests for me too

Re: Why doesn't GiST VACUUM require a super-exclusive lock, like nbtree VACUUM?

2025-03-09 Thread Michail Nikolaev
Hello, Mathias! > though I suspect the SP-GIST tests to have > bugs, as an intermediate version of my 0003 patch didn't trigger the > tests to fail It all fails on master - could you please detail what is "intermediate" in that case? Also, I think it is a good idea to add the same type of test t

Re: Commitfest app release on Feb 17 with many improvements

2025-03-09 Thread Jelte Fennema-Nio
On Sun, 9 Mar 2025 at 03:21, vignesh C wrote: > Couple of suggestions: a) No need to show CI status as "Needs rebase," > "Not processed," etc., for committed patches. Do you mean specifically for committed ones? Or just for any patch with a "closed" status. > b) Can we add a filter > for "Needs

Re: Add RESPECT/IGNORE NULLS and FROM FIRST/LAST options

2025-03-09 Thread Oliver Ford
On Sun, Mar 9, 2025 at 6:40 AM Tatsuo Ishii wrote: > > Attached version removes the non-nulls array. That seems to speed > > everything up. Running the above query with 1 million rows averages > 450ms, > > similar when using lead/lag. > > Great. However, CFbot complains about the patch: > > http

Re: Log connection establishment timings

2025-03-09 Thread Jacob Champion
On Thu, Mar 6, 2025 at 3:16 PM Melanie Plageman wrote: > > Jacob at some point had asked about this, and I didn't > have a satisfactory answer. I'm not really sure what would be more > useful to end users. For the record, I'm not really sure either. I don't have a strong opinion either way. --Ja

Re: maintenance_work_mem = 64kB doesn't work for vacuum

2025-03-09 Thread David Rowley
On Mon, 10 Mar 2025 at 07:46, Masahiko Sawada wrote: > A simple fix is to bump the minimum maintenance_work_mem to 256kB. We > would break the compatibility for backbranch (i.e. v17) but I guess > it's unlikely that existing v17 users are using less than 1MB > maintenance_work_mem (the release not

Re: Printing window function OVER clauses in EXPLAIN

2025-03-09 Thread Tom Lane
I wrote: > I'll go try to code this up. OK, here's v2 done like that. I do like this output better. I backed off the idea of putting the WindowClause as such into the plan, partly because I didn't feel like debugging the setrefs.c problem that David discovered upthread. This way does require a bi

Re: Parallel heap vacuum

2025-03-09 Thread Peter Smith
Hi Sawada-San. Here are some review comments for patch v11-0002 == Commit message. 1. Heap table AM disables the parallel heap vacuuming for now, but an upcoming patch uses it. This function implementation was moved into patch 0001, so probably this part of the commit message comment also b

Re: Parallel heap vacuum

2025-03-09 Thread Peter Smith
Hi Sawada-San, Here are some review comments for patch v11-0001. == src/backend/access/heap/vacuumlazy.c 1. +/* + * Compute the number of workers for parallel heap vacuum. + * + * Return 0 to disable parallel vacuum so far. + */ +int +heap_parallel_vacuum_compute_workers(Relation rel, int nw

Re: Parallel CREATE INDEX for GIN indexes

2025-03-09 Thread Peter Geoghegan
On Sun, Mar 9, 2025 at 6:23 PM Tom Lane wrote: > Ah. Most likely somebody dismissed it years ago. Given that > precedent, I'm content to dismiss this one too. It is dead code, unless somebody decides to #define DISABLE_LEADER_PARTICIPATION to debug a problem. -- Peter Geoghegan

Re: Parallel CREATE INDEX for GIN indexes

2025-03-09 Thread Tom Lane
Tomas Vondra writes: > On 3/9/25 17:38, Tom Lane wrote: >> Coverity is a little unhappy about this business in >> _gin_begin_parallel: > I don't mind doing it differently, but this code is just a copy from > _bt_begin_parallel. So how come coverity does not complain about that? > Or is that white

Re: what's going on with lapwing?

2025-03-09 Thread Robert Haas
On Thu, Mar 6, 2025 at 4:27 PM Tom Lane wrote: > I think you misunderstood my drift. I'm okay with setting a project > policy that we won't support OSes that are more than N years EOL, > as long as it's phrased to account for older PG branches properly. Yep, I misunderstood. That sounds awesome.

Re: Parallel CREATE INDEX for GIN indexes

2025-03-09 Thread Tomas Vondra
On 3/9/25 17:38, Tom Lane wrote: > Tomas Vondra writes: >> I pushed the two smaller parts today. > > Coverity is a little unhappy about this business in > _gin_begin_parallel: > > boolleaderparticipates = true; > ... > #ifdef DISABLE_LEADER_PARTICIPATION > leader

Re: pgsql: reindexdb: Add the index-level REINDEX with multiple jobs

2025-03-09 Thread Alexander Korotkov
On Sun, Mar 9, 2025 at 4:53 AM Alexander Korotkov wrote: > On Sat, Mar 8, 2025 at 12:49 PM Alexander Korotkov > wrote: > > On Fri, Mar 7, 2025 at 8:20 PM Álvaro Herrera > > wrote: > > > > > > On 2024-Mar-25, Alexander Korotkov wrote: > > > > > > > reindexdb: Add the index-level REINDEX with mu

Re: maintenance_work_mem = 64kB doesn't work for vacuum

2025-03-09 Thread Melanie Plageman
On Sun, Mar 9, 2025 at 9:24 PM John Naylor wrote: > > On Mon, Mar 10, 2025 at 1:46 AM Masahiko Sawada wrote: > > > > Commit bbf668d66fbf6 (back-patched to v17) lowered the minimum > > maintenance_work_mem to 64kB, but it doesn't work for parallel vacuum > > That was done in the first place to mak

maintenance_work_mem = 64kB doesn't work for vacuum

2025-03-09 Thread Masahiko Sawada
Hi, Commit bbf668d66fbf6 (back-patched to v17) lowered the minimum maintenance_work_mem to 64kB, but it doesn't work for parallel vacuum cases since the minimum dsa segment size (DSA_MIN_SEGMENT_SIZE) is 256kB. As soon as the radix tree allocates its control object and the root node, the memory us

Re: Add regression test checking combinations of (object,backend_type,context) in pg_stat_io

2025-03-09 Thread Michael Paquier
On Wed, Mar 05, 2025 at 09:19:16PM +0900, Michael Paquier wrote: > On Wed, Mar 05, 2025 at 07:34:16AM +, Bertrand Drouvot wrote: >> What about adding some extra paranoia like? >> >> SELECT backend_type, object, context FROM pg_stat_io ORDER BY >> backend_type, object, context COLLATE "C"; > >

RE: Selectively invalidate caches in pgoutput module

2025-03-09 Thread Hayato Kuroda (Fujitsu)
I found cfbot got angry due to a variable-shadowing. PSA fixed version. Best regards, Hayato Kuroda FUJITSU LIMITED v7-0001-Introduce-a-new-invalidation-message-to-invalidat.patch Description: v7-0001-Introduce-a-new-invalidation-message-to-invalidat.patch v7-0002-Invalidate-Relcaches-while-

Re: Add an option to skip loading missing publication to avoid logical replication failure

2025-03-09 Thread Dilip Kumar
On Mon, Mar 10, 2025 at 9:33 AM Amit Kapila wrote: > On Tue, Mar 4, 2025 at 6:54 PM vignesh C wrote: > > > > On further thinking, I felt the use of publications_updated variable > > is not required we can use publications_valid itself which will be set > > if the publication system table is inva

Re: Enhance 'pg_createsubscriber' to retrieve databases automatically when no database is provided.

2025-03-09 Thread Ashutosh Bapat
On Thu, Mar 6, 2025 at 9:18 AM Ajin Cherian wrote: > + Subscription names, publication names, and replication slot names are > + automatically generated. Cannot be used together with > + --database, --publication, > + --replication-slot or > --subscription. > > Don't star

Re: RFC: Logging plan of the running query

2025-03-09 Thread torikoshia
On 2025-03-09 00:42, Akshat Jaimini wrote: Hi, I think there is still some problem with the patch. I am not able to apply it to the master branch. Can you please take another look at it? Thanks for pointing it out! Modified it. BTW the patch adds about 400 lines to explain.c and it may be bet

Re: Add an option to skip loading missing publication to avoid logical replication failure

2025-03-09 Thread Amit Kapila
On Tue, Mar 4, 2025 at 6:54 PM vignesh C wrote: > > On further thinking, I felt the use of publications_updated variable > is not required we can use publications_valid itself which will be set > if the publication system table is invalidated. Here is a patch for > the same. > The patch relies on

Re: Parallel heap vacuum

2025-03-09 Thread Amit Kapila
On Wed, Mar 5, 2025 at 6:25 AM Masahiko Sawada wrote: > > On Mon, Mar 3, 2025 at 3:24 PM Masahiko Sawada wrote: > > > > > > Another performance regression I can see in the results is that heap > > vacuum phase (phase III) got slower with the patch. It's weired to me > > since I don't touch the co

Re: Parallel heap vacuum

2025-03-09 Thread Amit Kapila
On Fri, Mar 7, 2025 at 11:06 PM Masahiko Sawada wrote: > > Discussing with Amit offlist, I've run another benchmark test where no > data is loaded on the shared buffer. In the previous test, I loaded > all table blocks before running vacuum, so it was the best case. The > attached test results sho

Re: Adding a '--clean-publisher-objects' option to 'pg_createsubscriber' utility.

2025-03-09 Thread Shubham Khanna
On Wed, Mar 5, 2025 at 3:55 PM Nisha Moond wrote: > > On Tue, Mar 4, 2025 at 8:05 PM Shubham Khanna > wrote: > > > > The attached Patch contains the suggested changes. > > > > Hi Shubham, > > Here are few comments for 040_pg_createsubscriber.pl > > 1) > +# Run pg_createsubscriber on node S using

Re: Make tuple deformation faster

2025-03-09 Thread David Rowley
On Thu, 6 Mar 2025 at 10:17, Andres Freund wrote: > FWIW, I am fairly certain that I looked at this at an earlier state of the > patch, and at least for me the issue wasn't that it was inherently slower to > use the bitmask, but that it was hard to convince the compiler not generate > worse code.

Re: Restrict copying of invalidated replication slots

2025-03-09 Thread Shlok Kyal
On Fri, 28 Feb 2025 at 08:56, Amit Kapila wrote: > > On Fri, Feb 28, 2025 at 5:10 AM Masahiko Sawada wrote: > > > > On Thu, Feb 27, 2025 at 12:52 AM Amit Kapila > > wrote: > > > > > > On Thu, Feb 27, 2025 at 10:47 AM Masahiko Sawada > > > wrote: > > > > > > > > On Tue, Feb 25, 2025 at 7:33 PM

Re: Adding a '--clean-publisher-objects' option to 'pg_createsubscriber' utility.

2025-03-09 Thread Shubham Khanna
On Thu, Mar 6, 2025 at 9:27 AM Peter Smith wrote: > > Hi Shubham. > > Some review comments for patch v13-0001. > > == > GENERAL > > 1. > --cleanup-existing-publications > > I've never liked this proposed switch name much. > > e.g. why say "cleanup" instead of "drop"? What is the difference? >

Re: SQLFunctionCache and generic plans

2025-03-09 Thread Pavel Stehule
Hi čt 6. 3. 2025 v 9:57 odesílatel Alexander Pyhalov napsal: > Hi. > > Tom Lane писал(а) 2025-02-27 23:40: > > Alexander Pyhalov writes: > >> Now sql functions plans are actually saved. The most of it is a > >> simplified version of plpgsql plan cache. Perhaps, I've missed > >> something. > > >

Re: Enhance file_fdw to report processed and skipped tuples in COPY progress

2025-03-09 Thread Fujii Masao
On 2025/03/09 20:38, vignesh C wrote: I've updated the status to "withdrawn." Feel free to add it again anytime if you change your mind. Thanks! Regards, -- Fujii Masao Advanced Computing Technology Center Research and Development Headquarters NTT DATA CORPORATION

Re: Query ID Calculation Fix for DISTINCT / ORDER BY and LIMIT / OFFSET

2025-03-09 Thread Michael Paquier
On Thu, Mar 06, 2025 at 06:44:27PM -0600, Sami Imseih wrote: > Regarding the issue itself, query jumbling behavior is often subjective, > making it difficult to classify as a bug. I'm not entirely sure this > qualifies as a bug either, but I do believe it should be addressed. I would call that a b

Re: Query ID Calculation Fix for DISTINCT / ORDER BY and LIMIT / OFFSET

2025-03-09 Thread David Rowley
On Mon, 10 Mar 2025 at 12:39, Michael Paquier wrote: > > On Thu, Mar 06, 2025 at 06:44:27PM -0600, Sami Imseih wrote: > > Regarding the issue itself, query jumbling behavior is often subjective, > > making it difficult to classify as a bug. I'm not entirely sure this > > qualifies as a bug either,

Re: Enhance 'pg_createsubscriber' to retrieve databases automatically when no database is provided.

2025-03-09 Thread Ajin Cherian
On Mon, Mar 10, 2025 at 3:58 PM Ashutosh Bapat wrote: > > On Thu, Mar 6, 2025 at 9:18 AM Ajin Cherian wrote: > > > + Subscription names, publication names, and replication slot names > > are > > + automatically generated. Cannot be used together with > > + --database, --publica

Re: maintenance_work_mem = 64kB doesn't work for vacuum

2025-03-09 Thread Masahiko Sawada
On Sun, Mar 9, 2025 at 7:03 PM David Rowley wrote: > > On Mon, 10 Mar 2025 at 10:30, David Rowley wrote: > > Could you do something similar to what's in hash_agg_check_limits() > > where we check we've got at least 1 item before bailing before we've > > used up the all the prescribed memory? Tha

Re: Orphaned users in PG16 and above can only be managed by Superusers

2025-03-09 Thread Ashutosh Sharma
Hi, On Fri, Mar 7, 2025 at 10:55 PM Nathan Bossart wrote: > > I noticed that much of this code is lifted from DropRole(), and the new > check_drop_role_dependency() function is only used by DropRole() right > before it does the exact same scans. Couldn't we put the new dependency > detection in

Re: Printing window function OVER clauses in EXPLAIN

2025-03-09 Thread Álvaro Herrera
On 2025-Mar-09, Tom Lane wrote: > David Rowley writes: > > What are your thoughts on being a bit more brief with the naming and > > just prefix with "w" instead of "window"? Looking at window.out, I see > > that the EXPLAIN output does become quite a bit wider than before. I > > favour the idea o

Re: [BUG]: the walsender does not update its IO statistics until it exits

2025-03-09 Thread Michael Paquier
On Mon, Mar 03, 2025 at 11:54:39AM +, Bertrand Drouvot wrote: > So it does not look like what we're adding here can be seen as a primary > bottleneck > but that is probably worth implementing the "have_iostats" optimization > attached. > > Also, while I did not measure any noticeable extra l

Re: Printing window function OVER clauses in EXPLAIN

2025-03-09 Thread David Rowley
On Mon, 10 Mar 2025 at 14:13, Tom Lane wrote: > Hmm, OK. Do you think it could be sensible to put Run Condition > before Filter, then? On the same grounds of "keeping related > things together", it could be argued that Run Condition is > related to the Window property. Also, the Run Condition a

Re: Query ID Calculation Fix for DISTINCT / ORDER BY and LIMIT / OFFSET

2025-03-09 Thread Michael Paquier
On Mon, Mar 10, 2025 at 02:14:01PM +1300, David Rowley wrote: > I know you reviewed this, Michael, so you're aware; 2d3389c28 did > recently document that we'd only break this in minor versions as a > last resort. So, I agree that it sounds like a master-only fix is in > order. Yes, this thread's

Re: Add an option to skip loading missing publication to avoid logical replication failure

2025-03-09 Thread Amit Kapila
On Sun, Mar 9, 2025 at 9:00 AM Masahiko Sawada wrote: > > On Tue, Mar 4, 2025 at 9:04 PM Amit Kapila wrote: > > > > > I see the point of adding such an option to avoid breaking the current > > applications (if there are any) that are relying on current behaviour. > > But OTOH, I am not sure if us

Re: Printing window function OVER clauses in EXPLAIN

2025-03-09 Thread David Rowley
On Mon, 10 Mar 2025 at 11:19, Tom Lane wrote: > OK, here's v2 done like that. I do like this output better. > I backed off the idea of putting the WindowClause as such > into the plan, partly because I didn't feel like debugging > the setrefs.c problem that David discovered upthread. > This way d

Re: CREATE OR REPLACE MATERIALIZED VIEW

2025-03-09 Thread Erik Wienhold
The attached v6 fixes the build. Somehow I missed testing with --with-cassert the whole time and it turned that out I forgot to pass queryString to ExecRefreshMatView. -- Erik Wienhold >From 6ec126d8da5ca80f93ea8a58e07d654f5e21ef6d Mon Sep 17 00:00:00 2001 From: Erik Wienhold Date: Tue, 21 May