RE: Synchronizing slots from primary to standby

2024-03-02 Thread Zhijie Hou (Fujitsu)
On Saturday, March 2, 2024 6:55 PM Amit Kapila wrote: > > On Sat, Mar 2, 2024 at 9:21 AM Zhijie Hou (Fujitsu) > wrote: > > > > Apart from the comments, the code in WalSndWaitForWal was refactored a > > bit to make it neater. Thanks Shveta for helping writing the code and doc. > > > > A few

RE: Synchronizing slots from primary to standby

2024-03-02 Thread Zhijie Hou (Fujitsu)
On Sunday, March 3, 2024 7:47 AM Peter Smith wrote: > > On Sat, Mar 2, 2024 at 2:51 PM Zhijie Hou (Fujitsu) > wrote: > > > > On Friday, March 1, 2024 12:23 PM Peter Smith > wrote: > > > > ... > > > == > > > src/backend/replication/slot.c > > > > > > 2. validate_standby_slots > > > > > > +

a wrong index choose when statistics is out of date

2024-03-02 Thread Andy Fan
The issue can be reproduced with the following steps: create table x_events (.., created_at timestamp, a int, b int); create index idx_1 on t(created_at, a); create index idx_2 on t(created_at, b); query: select * from t where create_at = current_timestamp and b = 1; index (created_at, a)

Re: Make query cancellation keys longer

2024-03-02 Thread Jelte Fennema-Nio
On Fri, 1 Mar 2024 at 15:19, Peter Eisentraut wrote: > > One complication with this was that because we no longer know how long > > the key should be, 4-bytes or something longer, until the backend has > > performed the protocol negotiation, we cannot generate the key in the > > postmaster before

Re: Shared detoast Datum proposal

2024-03-02 Thread Andy Fan
Hi, Here is a updated version, the main changes are: 1. an shared_detoast_datum.org file which shows the latest desgin and pending items during discussion. 2. I removed the slot->pre_detoast_attrs totally. 3. handle some pg_detoast_datum_slice use case. 4. Some implementation improvement.

Re: [PoC] Improve dead tuple storage for lazy vacuum

2024-03-02 Thread John Naylor
On Fri, Mar 1, 2024 at 3:01 PM Masahiko Sawada wrote: > > On Thu, Feb 29, 2024 at 8:43 PM John Naylor wrote: > > + ts->rt_context = AllocSetContextCreate(CurrentMemoryContext, > > +"tidstore storage", > > > > "tidstore storage" sounds a bit strange -- maybe look at some other > > context

[docs] revise ORDER BY documentation

2024-03-02 Thread Dian Fay
I recently encountered some odd behavior with a query both selecting and sorting by `random()`. When I posted about it on pgsql-bugs ^1, David Johnston and Tom Lane provided some very detailed explanations as to what was happening, but weren't sure whether or where information about it could live

Re: Documentation: warn about two_phase when altering a subscription

2024-03-02 Thread Amit Kapila
On Sat, Mar 2, 2024 at 11:44 PM Andrey M. Borodin wrote: > > > On 26 Feb 2024, at 14:14, Bertrand Drouvot > > wrote: > > > > As the patch as it is now looks good to Amit (see [1]), I prefer to let him > > decide which wording he pefers to push. > > Added Amit to cc, just to be sure. Thanks! >

Re: Synchronizing slots from primary to standby

2024-03-02 Thread Amit Kapila
On Sun, Mar 3, 2024 at 5:17 AM Peter Smith wrote: > > ~~~ > > 3. > + > + > + Value * is not accepted as it is inappropriate to > + block logical replication for physical slots that either lack > + associated standbys or have standbys associated that are not

Re: Shared detoast Datum proposal

2024-03-02 Thread Andy Fan
Hi Nikita, > > Have you considered another one - to alter pg_detoast_datum > (actually, it would be detoast_attr function) and save > detoasted datums in the detoast context derived > from the query context? > > We have just enough information at this step to identify > the datum - toast

psql: fix variable existence tab completion

2024-03-02 Thread Steve Chavez
Hello hackers, psql has the :{?name} syntax for testing a psql variable existence. But currently doing \echo :{?VERB doesn't trigger tab completion. This patch fixes it. I've also included a TAP test. Best regards, Steve Chavez From adb1f997b67d8ef603017ab34e1b9061e4e229ea Mon Sep 17 00:00:00

Re: BitmapHeapScan streaming read user and prelim refactoring

2024-03-02 Thread Melanie Plageman
On Sat, Mar 2, 2024 at 6:59 PM Tomas Vondra wrote: > > > > On 3/1/24 17:51, Melanie Plageman wrote: > > On Fri, Mar 1, 2024 at 9:05 AM Tomas Vondra > > wrote: > >> > >> On 3/1/24 02:18, Melanie Plageman wrote: > >>> On Thu, Feb 29, 2024 at 6:44 PM Tomas Vondra > >>> wrote: > > On

Re: pub/sub - specifying optional parameters without values.

2024-03-02 Thread Peter Smith
On Fri, Jan 12, 2024 at 4:07 PM Peter Smith wrote: > > On Mon, Jan 30, 2023 at 8:36 AM Tom Lane wrote: > > > > Zheng Li writes: > > > The behavior is due to the following code > > > https://github.com/postgres/postgres/blob/master/src/backend/commands/define.c#L113 > > > > Yeah, so you can grep

Re: Synchronizing slots from primary to standby

2024-03-02 Thread Peter Smith
On Sat, Mar 2, 2024 at 2:51 PM Zhijie Hou (Fujitsu) wrote: > > On Friday, March 1, 2024 12:23 PM Peter Smith wrote: > > ... > > == > > src/backend/replication/slot.c > > > > 2. validate_standby_slots > > > > + else if (!ReplicationSlotCtl) > > + { > > + /* > > + * We cannot validate the

Re: BitmapHeapScan streaming read user and prelim refactoring

2024-03-02 Thread Melanie Plageman
On Sat, Mar 2, 2024 at 5:51 PM Tomas Vondra wrote: > > On 3/2/24 23:11, Melanie Plageman wrote: > > On Fri, Mar 1, 2024 at 2:31 PM Melanie Plageman > > wrote: > >> > >> ... > >> > >> Hold the phone on this one. I realized why I moved > >> BitmapAdjustPrefetchIterator after

Re: Streaming read-ready sequential scan code

2024-03-02 Thread Melanie Plageman
On Wed, Feb 28, 2024 at 12:30 PM Melanie Plageman wrote: > > On Mon, Feb 26, 2024 at 03:56:57PM -0500, Melanie Plageman wrote: > > On Mon, Feb 19, 2024 at 6:05 PM Melanie Plageman > > wrote: > > > > > > On Mon, Jan 29, 2024 at 4:17 PM Melanie Plageman > > > wrote: > > > > > > > > There is an

Re: BitmapHeapScan streaming read user and prelim refactoring

2024-03-02 Thread Melanie Plageman
On Sat, Mar 2, 2024 at 5:41 PM Tomas Vondra wrote: > > > > On 3/2/24 23:28, Melanie Plageman wrote: > > On Sat, Mar 2, 2024 at 10:05 AM Tomas Vondra > > wrote: > >> > >> Here's a PDF with charts for a dataset where the row selectivity is more > >> correlated to selectivity of pages. I'm

Re: BitmapHeapScan streaming read user and prelim refactoring

2024-03-02 Thread Tomas Vondra
On 3/2/24 23:11, Melanie Plageman wrote: > On Fri, Mar 1, 2024 at 2:31 PM Melanie Plageman > wrote: >> >> ... >> >> Hold the phone on this one. I realized why I moved >> BitmapAdjustPrefetchIterator after table_scan_bitmap_next_block() in >> the first place -- master calls

Re: BitmapHeapScan streaming read user and prelim refactoring

2024-03-02 Thread Tomas Vondra
On 3/2/24 23:28, Melanie Plageman wrote: > On Sat, Mar 2, 2024 at 10:05 AM Tomas Vondra > wrote: >> >> Here's a PDF with charts for a dataset where the row selectivity is more >> correlated to selectivity of pages. I'm attaching the updated script, >> with the SQL generating the data set. But

Re: Failures in constraints regression test, "read only 0 of 8192 bytes"

2024-03-02 Thread Tomas Vondra
These are "my" animals (running at a local university). There's a couple interesting details: 1) the animals run on the same machine (one with gcc, one with clang) 2) I did upgrade the OS and restarted the machine on 2024/02/26, i.e. right before the failures started These might be just

Re: BitmapHeapScan streaming read user and prelim refactoring

2024-03-02 Thread Melanie Plageman
On Sat, Mar 2, 2024 at 10:05 AM Tomas Vondra wrote: > > Here's a PDF with charts for a dataset where the row selectivity is more > correlated to selectivity of pages. I'm attaching the updated script, > with the SQL generating the data set. But the short story is all rows on > a single page have

Re: BitmapHeapScan streaming read user and prelim refactoring

2024-03-02 Thread Melanie Plageman
On Fri, Mar 1, 2024 at 2:31 PM Melanie Plageman wrote: > > On Thu, Feb 29, 2024 at 7:29 PM Melanie Plageman > wrote: > > > > On Thu, Feb 29, 2024 at 5:44 PM Tomas Vondra > > wrote: > > > > > > > > > > > > On 2/29/24 22:19, Melanie Plageman wrote: > > > > On Thu, Feb 29, 2024 at 7:54 AM Tomas

Failures in constraints regression test, "read only 0 of 8192 bytes"

2024-03-02 Thread Thomas Munro
These two animals seem to have got mixed up about about the size of this relation in the same place: https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=avocet=2024-02-28%2017%3A34%3A30 https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=trilobite=2024-03-01%2006%3A47%3A53 +++

Re: CF entries for 17 to be reviewed

2024-03-02 Thread Melanie Plageman
On Sat, Mar 2, 2024 at 1:32 PM Andrey M. Borodin wrote: > > Hi hackers! > > In this thread, I want to promote entries from CommitFest that require > review. I have scanned through the bugs, clients, and documentation sections, > and here is my take on the current situation. All of these threads

CF entries for 17 to be reviewed

2024-03-02 Thread Andrey M. Borodin
Hi hackers! In this thread, I want to promote entries from CommitFest that require review. I have scanned through the bugs, clients, and documentation sections, and here is my take on the current situation. All of these threads are currently in the "Needs review" state and were marked by the

Re: Documentation: warn about two_phase when altering a subscription

2024-03-02 Thread Andrey M. Borodin
> On 26 Feb 2024, at 14:14, Bertrand Drouvot > wrote: > > As the patch as it is now looks good to Amit (see [1]), I prefer to let him > decide which wording he pefers to push. Added Amit to cc, just to be sure. Thanks! Best regards, Andrey Borodin, learning how to be CFM.

Re: Commitfest Manager for March

2024-03-02 Thread Daniel Gustafsson
> On 1 Mar 2024, at 14:57, Andrey M. Borodin wrote: > >> On 1 Mar 2024, at 17:29, Daniel Gustafsson wrote: >> >> The call for a CFM volunteer is still open. > > I always wanted to try. And most of the stuff I'm interested in is already > committed. > > But given importance of last

Re: RFC: Logging plan of the running query

2024-03-02 Thread James Coleman
On Wed, Feb 28, 2024 at 1:18 AM Robert Haas wrote: > > On Mon, Feb 26, 2024 at 5:31 PM torikoshia wrote: > > It would be nice if there was a place accessed once every few seconds or > > so.. > > I think this comment earlier from Andres deserves close attention: > > # If we went with something

Re: Shared detoast Datum proposal

2024-03-02 Thread Nikita Malakhov
Hi, Andy! Sorry for the delay, I have had long flights this week. I've reviewed the patch set, thank you for your efforts. I have several notes about patch set code, but first of I'm not sure the overall approach is the best for the task. As Tomas wrote above, the approach is very invasive and

Re: Seeking Clarification on Logical Replication Start LSN

2024-03-02 Thread Amit Kapila
On Tue, Feb 27, 2024 at 5:56 PM Pradeep Kumar wrote: > > Dear Postgres Community, > > I hope this email finds you well. I am reaching out to seek clarification on > an issue I am encountering with logical replication in PostgreSQL. > > My specific question pertains to determining the appropriate

Re: Regardign RecentFlushPtr in WalSndWaitForWal()

2024-03-02 Thread Amit Kapila
On Fri, Mar 1, 2024 at 4:40 PM Matthias van de Meent wrote: > > On Mon, 26 Feb 2024 at 12:46, shveta malik wrote: > > > > Hi hackers, > > > > I would like to understand why we have code [1] that retrieves > > RecentFlushPtr in WalSndWaitForWal() outside of the loop. We utilize > > RecentFlushPtr

Re: Synchronizing slots from primary to standby

2024-03-02 Thread Amit Kapila
On Sat, Mar 2, 2024 at 9:21 AM Zhijie Hou (Fujitsu) wrote: > > Apart from the comments, the code in WalSndWaitForWal was refactored > a bit to make it neater. Thanks Shveta for helping writing the code and doc. > A few more comments: == 1. +# Wait until the primary server logs a