Improve comment on cid mapping (was Re: Adding CommandID to heap xlog records)

2023-06-25 Thread Heikki Linnakangas
On 28/02/2023 15:52, Heikki Linnakangas wrote: So unfortunately I don't see much opportunity to simplify logical decoding with this. However, please take a look at the first two patches attached. They're tiny cleanups that make sense on their own. Rebased these small patches. I'll add this to t

Re: Parallelize correlated subqueries that execute within each worker

2023-06-25 Thread Richard Guo
On Mon, Jun 12, 2023 at 10:23 AM James Coleman wrote: > BTW are you by any chance testing on ARM macOS? I reproduced the issue > there, but for some reason I did not reproduce the error (and the plan > wasn't parallelized) when I tested this on linux. Perhaps I missed > setting something up; it s

Re: Add GUC to tune glibc's malloc implementation.

2023-06-25 Thread Ronan Dunklau
Le vendredi 23 juin 2023, 22:55:51 CEST Peter Eisentraut a écrit : > On 22.06.23 15:35, Ronan Dunklau wrote: > > The thing is, by default, those parameters are adjusted dynamically by the > > glibc itself. It starts with quite small thresholds, and raises them when > > the program frees some memory

Re: Inquiry/Help with pg_adviser (problem in index_create function for creating indexes)

2023-06-25 Thread Heikki Linnakangas
On 25/06/2023 17:30, Ahmed Ibrahim wrote: The full current code (PR is still draft) can be found at https://github.com/DrPostgres/pg_adviser/pull/4 The idea behind what is being done is creating virtual indexes, and measuring the query cost af

Re: Synchronizing slots from primary to standby

2023-06-25 Thread Drouvot, Bertrand
Hi, On 6/20/23 12:22 PM, Amit Kapila wrote: On Mon, Jun 19, 2023 at 9:56 PM Drouvot, Bertrand wrote: In such a case (slot valid on the primary but invalidated on the standby) then I think we could drop and recreate the invalidated slot on the standby. Will it be safe? Because after recre

Re: Speeding Up Bitmapset

2023-06-25 Thread David Rowley
On Mon, 26 Jun 2023 at 12:55, Ranier Vilela wrote: > > Em dom., 25 de jun. de 2023 às 17:49, David Rowley > escreveu: >> >> There's no reason in the world >> that those will speed up Bitmapsets, so why include them? > > Of course optimization is the most important thing, > but since you're going

Re: Assert while autovacuum was executing

2023-06-25 Thread Amit Kapila
On Fri, Jun 23, 2023 at 10:07 PM Andres Freund wrote: > > On 2023-06-23 14:04:15 +0530, Amit Kapila wrote: > > OTOH, if the above theory is wrong or people are not convinced, I am > > okay with removing all the changes in commits 72e78d831a and > > 3ba59ccc89. > > I am not convinced. And even if I

Re: RFC: Adding \history [options] [filename] to psql (Snippets and Shared Queries)

2023-06-25 Thread Kirk Wolak
On Tue, Jun 13, 2023 at 1:59 AM Gurjeet Singh wrote: > On Mon, Jun 5, 2023 at 8:58 AM Kirk Wolak wrote: > > > > Everyone, > > After recently deep diving on some readline features and optimizing my > bash environment to have a static set of "snippets" that I can always > find... > > > > it ta

Re: POC, WIP: OR-clause support for indexes

2023-06-25 Thread Peter Geoghegan
On Sun, Jun 25, 2023 at 6:48 PM Alena Rybakina wrote: > I finished writing the code patch for transformation "Or" expressions to > "Any" expressions. This seems interesting to me. I'm currently working on improving nbtree's "native execution of ScalarArrayOpExpr quals" (see commit 9e8da0f7 for b

Re: Speeding Up Bitmapset

2023-06-25 Thread David Rowley
On Mon, 26 Jun 2023 at 12:55, Ranier Vilela wrote: > Have you seen bms_compare? > For some reason someone thought it would be better to loop backward the array. That's nothing to do with efficiency. It's related to behaviour. Have a look at the function's header comment, it's trying to find the s

Re: POC, WIP: OR-clause support for indexes

2023-06-25 Thread Alena Rybakina
Sorry,  I wrote the last sentence in a confusing way, I meant that I formed transformations for any number of "or" expressions (const_transform_or_limit=1). in regression tests, I noticed only diff changes of transformations of "or" expressions to "any". I attach a file with diff. On 26.06.20

Re: [PATCH] Reuse Workers and Replication Slots during Logical Replication

2023-06-25 Thread Peter Smith
On Fri, Jun 23, 2023 at 11:50 PM Melih Mutlu wrote: > > > src/backend/replication/logical/worker.c > > > > 10. General -- run_tablesync_worker, TablesyncWorkerMain > > > > IMO these functions would be more appropriately reside in the > > tablesync.c instead of the (common) worker.c. Was there some

Re: Do we want a hashset type?

2023-06-25 Thread jian he
On Mon, Jun 26, 2023 at 2:56 AM Tomas Vondra wrote: > > > > On 6/25/23 15:32, jian he wrote: > >> Or maybe I just don't understand the proposal. Perhaps it'd be best if > >> jian wrote a patch illustrating the idea, and showing how it performs > >> compared to the current approach. > > > > current

Re: POC, WIP: OR-clause support for indexes

2023-06-25 Thread Alena Rybakina
Hi, all! Sorry I haven't written for a long time. I finished writing the code patch for transformation "Or" expressions to "Any" expressions. I didn't see any problems in regression tests, even when I changed the constant at which the minimum or expression is replaced by any at 0. I ran my pat

Re: Row pattern recognition

2023-06-25 Thread Tatsuo Ishii
> I have been dreaming of and lobbying for someone to pick up this > feature. I will be sure to review it from a standards perspective and > will try my best to help with the technical aspect, but I am not sure > to have the qualifications for that. > > THANK YOU! Thank you for looking into my p

Re: Speeding Up Bitmapset

2023-06-25 Thread Ranier Vilela
Em dom., 25 de jun. de 2023 às 17:49, David Rowley escreveu: > There's no reason in the world > that those will speed up Bitmapsets, so why include them? > Of course optimization is the most important thing, but since you're going to touch the source, why not make it more readable. > > > v7 out

Re: eqjoinsel_semi still sucks ...

2023-06-25 Thread Alena Rybakina
On 23.06.2023 14:28, Andrey Lepikhov wrote: On 2/5/2012 20:34, Tom Lane wrote: On reflection I think that the idea of clamping ndistinct beforehand is just wrong, and what we ought to do instead is apply a multiplier to the selectivity estimate afterwards.  In the case of a base rel we could jus

Re: Row pattern recognition

2023-06-25 Thread Vik Fearing
On 6/25/23 14:05, Tatsuo Ishii wrote: Attached is a PoC patch to implement "Row pattern recognition" (RPR) in SQL:2016 (I know SQL:2023 is already out, but I don't have access to it). Actually SQL:2016 defines RPR in two places[1]: Feature R010, “Row pattern recognition: FROM clause” F

Re: Speeding Up Bitmapset

2023-06-25 Thread David Rowley
On Mon, 26 Jun 2023 at 00:29, Ranier Vilela wrote: > Yuya Watari presented a series of patches, with the objective of improving > the Bitmapset [1]. > After reading through the patches, I saw a lot of good ideas and thought I'd > help. > Unfortunately, my suggestions were not well received. For

Re: Do we want a hashset type?

2023-06-25 Thread Joel Jacobson
On Sun, Jun 25, 2023, at 11:42, Joel Jacobson wrote: > SELECT hashset_contains('{}'::int4hashset, NULL::int); > > would be False, according to the General Rules. > ... > Applying the same rules, we'd have to return Unknown (which we represent as > null) for: > > SELECT hashset_contains('{nu

Re: Stampede of the JIT compilers

2023-06-25 Thread James Coleman
On Sun, Jun 25, 2023 at 5:10 AM Michael Banck wrote: > > Hi, > > On Sat, Jun 24, 2023 at 01:54:53PM -0400, Tom Lane wrote: > > I don't know whether raising the default would be enough to fix that > > in a nice way, and I certainly don't pretend to have a specific value > > to offer. But it's unde

Re: Do we want a hashset type?

2023-06-25 Thread Tomas Vondra
On 6/25/23 15:32, jian he wrote: >> Or maybe I just don't understand the proposal. Perhaps it'd be best if >> jian wrote a patch illustrating the idea, and showing how it performs >> compared to the current approach. > > currently joel's idea is a int4hashset. based on the code first tomas wrot

Re: vac_truncate_clog()'s bogus check leads to bogusness

2023-06-25 Thread Noah Misch
On Fri, Jun 23, 2023 at 06:41:58PM -0700, Andres Freund wrote: > On 2023-06-21 21:50:39 -0700, Noah Misch wrote: > > On Wed, Jun 21, 2023 at 05:46:37PM -0700, Andres Freund wrote: > > > A related issue is that as far as I can tell the determination of what is > > > bogus is bogus. > > > > > > The

Re: DROP DATABASE is interruptible

2023-06-25 Thread Andres Freund
Hi, On 2023-06-21 12:02:04 -0700, Andres Freund wrote: > I'm hacking on this bugfix again, thanks to Evgeny's reminder on the other > thread [1]. > > > I've been adding checks for partiall-dropped databases to the following places > so far: > - vac_truncate_clog(), as autovacuum can't process it

Re: Castable Domains for different JSON representations

2023-06-25 Thread Tom Lane
Steve Chavez writes: > Currently domain casts are ignored. Yet this would be very useful for > representing data in different formats such as json. Hm. Usually what people ask for in this space is custom casts *to* a domain type, which is problematic because it's not clear how that should intera

Castable Domains for different JSON representations

2023-06-25 Thread Steve Chavez
Hello hackers, Currently domain casts are ignored. Yet this would be very useful for representing data in different formats such as json. Let's take a tsrange as an example. Its json output by default: select to_json('(2022-12-31 11:00, 2023-01-01 06:00)'::tsrange); to_jso

Re: 'converts internal representation to "..."' comment is confusing

2023-06-25 Thread Steve Chavez
Hello hackers, Tom, could we apply this patch since Robert agrees it's an improvement? Best regards, Steve On Tue, 16 May 2023 at 07:49, Robert Haas wrote: > On Sun, May 14, 2023 at 9:37 PM Tom Lane wrote: > > Steve Chavez writes: > > > I found "..." confusing in some comments, so this patch

Re: psql: Add role's membership options to the \du+ command

2023-06-25 Thread Pavel Luzanov
On 24.06.2023 18:57, David G. Johnston wrote: On Sat, Jun 24, 2023 at 8:11 AM Pavel Luzanov wrote: There are two commands showing the same information about roles: \du and \dr. I would add \dr as the new official command to complement adding \drg and deprecate both \du and \dg. 

Re: Inquiry/Help with pg_adviser (problem in index_create function for creating indexes)

2023-06-25 Thread Ahmed Ibrahim
Hi, Since some people prefer plain text over screenshots/pdfs (but I think the pdf is more readable), I will post the problem here, in case anyone can help. I will appreciate that :) The full current code (PR is still draft) can be found at https://github.com/DrPostgres/pg_adviser/pull/4 The ide

Re: Do we want a hashset type?

2023-06-25 Thread jian he
> Or maybe I just don't understand the proposal. Perhaps it'd be best if > jian wrote a patch illustrating the idea, and showing how it performs > compared to the current approach. currently joel's idea is a int4hashset. based on the code first tomas wrote. it looks like a non-nested an collection

Speeding Up Bitmapset

2023-06-25 Thread Ranier Vilela
Hi, Yuya Watari presented a series of patches, with the objective of improving the Bitmapset [1]. After reading through the patches, I saw a lot of good ideas and thought I'd help. Unfortunately, my suggestions were not well received. Even so, I decided to work on these patches and see what could

Row pattern recognition

2023-06-25 Thread Tatsuo Ishii
Attached is a PoC patch to implement "Row pattern recognition" (RPR) in SQL:2016 (I know SQL:2023 is already out, but I don't have access to it). Actually SQL:2016 defines RPR in two places[1]: Feature R010, “Row pattern recognition: FROM clause” Feature R020, “Row pattern recognition: WIN

Re: Do we want a hashset type?

2023-06-25 Thread Joel Jacobson
On Sat, Jun 24, 2023, at 21:16, Joel Jacobson wrote: > New version of int4hashset_contains() that should follow the same > General Rules as MULTISET's MEMBER OF (8.16 ). ... > SELECT hashset_contains('{}'::int4hashset, NULL::int); -- false ... > SELECT hashset_contains('{null}'::int4hashset, NULL::

Re: Stampede of the JIT compilers

2023-06-25 Thread Michael Banck
Hi, On Sat, Jun 24, 2023 at 01:54:53PM -0400, Tom Lane wrote: > I don't know whether raising the default would be enough to fix that > in a nice way, and I certainly don't pretend to have a specific value > to offer. But it's undeniable that we have a serious problem here, > to the point where JI

Re: Incremental sort for access method with ordered scan support (amcanorderbyop)

2023-06-25 Thread Richard Guo
On Thu, Apr 20, 2023 at 9:37 PM Miroslav Bendik wrote: > Thanks for this fix. Now the version > am_orderbyop_incremental_sort_v3.1.patch [1] works without issues > using the master branch. The v3.1 patch looks good to me, except that the comments around match_pathkeys_to_index still need some p