Is deduplicate_items ever used in nbtree?

2020-09-20 Thread Nikolay Shaplov
Hi! I am still working with reloptions patches, and noticed that in current master deduplicate_items option exists, but never actually used. You can set, it, you can dump it, it has proper representation in BTOptions, it is mentioned in documentation, but it is never actually used in the code. O

Re: Parallel bitmap index scan

2020-09-20 Thread Dilip Kumar
On Sun, Jul 26, 2020 at 6:42 PM Dilip Kumar wrote: > > I would like to propose a patch for enabling the parallelism for the > bitmap index scan path. > > Background: > Currently, we support only a parallel bitmap heap scan path. Therein, > the underlying bitmap index scan is done by a single work

Binaries on s390x arch

2020-09-20 Thread Namrata Bhave
Hi, As seen from downloads page, the Apt repo/rpms are not yet available for s390x for latest versions. Wanted to know if there is any work going on/planned to provide Postgres in ready-to-use package or installer form for s390x architecture? Any pointers would be helpful. Thank you in advance.

RE: [PoC] Non-volatile WAL buffer

2020-09-20 Thread Deng, Gang
Hi Takashi, Thank you for the patch and work on accelerating PG performance with NVM. I applied the patch and made some performance test based on the patch v4. I stored database data files on NVMe SSD and stored WAL file on Intel PMem (NVM). I used two methods to store WAL file(s): 1. Lev

Re: Improper use about DatumGetInt32

2020-09-20 Thread Bharath Rupireddy
On Mon, Sep 21, 2020 at 6:47 AM Hou, Zhijie wrote: > > In (/contrib/bloom/blutils.c:277), I found it use DatumGetInt32 to get UInt32 > type. > Is it more appropriate to use DatumGetUInt32 here? > Makes sense. +1 for the patch. I think with the existing code also we don't have any problem. If we

Re: [HACKERS] logical decoding of two-phase transactions

2020-09-20 Thread Amit Kapila
On Sun, Sep 20, 2020 at 11:01 AM Dilip Kumar wrote: > > On Fri, Sep 18, 2020 at 6:02 PM Ajin Cherian wrote: > > > > 3. > > + /* > + * If it's ROLLBACK PREPARED then handle it via callbacks. > + */ > + if (TransactionIdIsValid(xid) && > + !SnapBuildXactNeedsSkip(ctx->snapshot_builder, buf->origptr

Re: [HACKERS] logical decoding of two-phase transactions

2020-09-20 Thread Amit Kapila
On Fri, Sep 18, 2020 at 6:02 PM Ajin Cherian wrote: > > On Tue, Sep 15, 2020 at 10:43 PM Amit Kapila wrote: > > > I don't think it is complete yet. > > * > > * This error can only occur when we are sending the data in > > * streaming mode and the streaming is not finished yet. > > */ > > - As

Re: VACUUM PARALLEL option vs. max_parallel_maintenance_workers

2020-09-20 Thread Amit Kapila
On Sun, Sep 20, 2020 at 7:15 PM Peter Eisentraut wrote: > > On 2020-09-19 13:24, Amit Kapila wrote: > >> I think the implemented behavior is wrong. > > > > It is the same as what we do for other parallel operations, for > > example, we limit the number of parallel workers for parallel create > > i

make MaxBackends available in _PG_init

2020-09-20 Thread Wang, Shenhao
Hi Hackers: I find the value in function _PG_init, the value of MaxBackends is 0. In source, I find that the postmaster will first load library, and then calculate the value of MaxBackends. In the old version, the MaxBackends was calculated by: MaxBackends = MaxConnections + autovacuum_

Re: Retry Cached Remote Connections for postgres_fdw in case remote backend gets killed/goes away

2020-09-20 Thread Bharath Rupireddy
On Thu, Sep 17, 2020 at 10:20 PM Fujii Masao wrote: > > In 1st way, you may also need to call ReleaseExternalFD() when new connection fails > to be made, as connect_pg_server() does. Also we need to check that > non-superuser has used password to make new connection, > as connect_pg_server() does?

Re: Dynamic gathering the values for seq_page_cost/xxx_cost

2020-09-20 Thread Andy Fan
Hi Tomas: Thanks for checking. On Fri, Sep 18, 2020 at 9:50 PM Tomas Vondra wrote: > >I recently tried something in this direction and the result looks > >promising based on my limited test. > > > >Since the unit of a xxx_cost is "seq_page_cost", then how to detect > >seq_page_cost is importa

Re: recovering from "found xmin ... from before relfrozenxid ..."

2020-09-20 Thread Amit Kapila
On Sun, Sep 20, 2020 at 10:43 PM Tom Lane wrote: > > I wrote: > > So this confirms the suspicion that the cause of the buildfarm > > failures is a concurrently-open transaction, presumably from > > autovacuum. I don't have time to poke further right now. > .. > 2. As Amit suspected, there's an in

Re: recovering from "found xmin ... from before relfrozenxid ..."

2020-09-20 Thread Ashutosh Sharma
Hi Tom, On Sun, Sep 20, 2020 at 10:43 PM Tom Lane wrote: > > I wrote: > > So this confirms the suspicion that the cause of the buildfarm > > failures is a concurrently-open transaction, presumably from > > autovacuum. I don't have time to poke further right now. > > I spent some more time analyz

Re: Handing off SLRU fsyncs to the checkpointer

2020-09-20 Thread Thomas Munro
On Sun, Sep 20, 2020 at 12:40 PM Thomas Munro wrote: > On Sat, Sep 19, 2020 at 5:06 PM Thomas Munro wrote: > > In the meantime, from the low-hanging-fruit department, here's a new > > version of the SLRU-fsync-offload patch. The only changes are a > > tweaked commit message, and adoption of C99

Improper use about DatumGetInt32

2020-09-20 Thread Hou, Zhijie
Hi In (/contrib/bloom/blutils.c:277), I found it use DatumGetInt32 to get UInt32 type. Is it more appropriate to use DatumGetUInt32 here? See the attachment for the patch Bes regards, houzj 0001-DatumGetUInt32.patch Description: 0001-DatumGetUInt32.patch

Re: Planner, check if can use consider HASH for groupings (src/backend/optimizer/plan/planner.c)

2020-09-20 Thread Tomas Vondra
On Sun, Sep 20, 2020 at 08:09:56PM -0300, Ranier Vilela wrote: Em sex., 18 de set. de 2020 às 10:37, Tomas Vondra < tomas.von...@2ndquadrant.com> escreveu: On Thu, Sep 17, 2020 at 06:31:12PM -0300, Ranier Vilela wrote: >Em qui., 17 de set. de 2020 às 17:09, Tomas Vondra < >tomas.von...@2ndquadr

Re: Planner, check if can use consider HASH for groupings (src/backend/optimizer/plan/planner.c)

2020-09-20 Thread Ranier Vilela
Em sex., 18 de set. de 2020 às 10:37, Tomas Vondra < tomas.von...@2ndquadrant.com> escreveu: > On Thu, Sep 17, 2020 at 06:31:12PM -0300, Ranier Vilela wrote: > >Em qui., 17 de set. de 2020 às 17:09, Tomas Vondra < > >tomas.von...@2ndquadrant.com> escreveu: > > > >> On Thu, Sep 17, 2020 at 02:12:12

Re: Yet another fast GiST build

2020-09-20 Thread Tom Lane
Justin Pryzby writes: > This also appears to break checksums. I was wondering about that, because the typical pattern for use of smgrextend for indexes seems to be RelationOpenSmgr(rel); PageSetChecksumInplace(page, lastblock); smgrextend(rel->rd_smgr, MAIN_FORKNUM, lastb

Re: Yet another fast GiST build

2020-09-20 Thread Justin Pryzby
On Sun, Sep 20, 2020 at 05:10:05PM -0400, Tom Lane wrote: > I wrote: > > It appears that hyrax (CLOBBER_CACHE_ALWAYS) is not very happy > > with this: > > https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=hyrax&dt=2020-09-19%2021%3A27%3A23 > > I reproduced that and traced it to a missing Rel

Re: Yet another fast GiST build

2020-09-20 Thread Tom Lane
I wrote: > It appears that hyrax (CLOBBER_CACHE_ALWAYS) is not very happy > with this: > https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=hyrax&dt=2020-09-19%2021%3A27%3A23 I reproduced that and traced it to a missing RelationOpenSmgr call. Fixed now. regards, tom l

Re: Refactor pg_rewind code and make it work against a standby

2020-09-20 Thread Soumyadeep Chakraborty
Hey Heikki, Thanks for refactoring and making the code much easier to read! Before getting into the code review for the patch, I wanted to know why we don't use a Bitmapset for target_modified_pages? Code review: 1. We need to update the comments for process_source_file and process_target_file

Re: Yet another fast GiST build

2020-09-20 Thread Tom Lane
Heikki Linnakangas writes: > Pushed. Thanks everyone! It appears that hyrax (CLOBBER_CACHE_ALWAYS) is not very happy with this: https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=hyrax&dt=2020-09-19%2021%3A27%3A23 We have a recent pass from prion, showing that -DRELCACHE_FORCE_RELEASE -DCA

Re: recovering from "found xmin ... from before relfrozenxid ..."

2020-09-20 Thread Tom Lane
I wrote: > So this confirms the suspicion that the cause of the buildfarm > failures is a concurrently-open transaction, presumably from > autovacuum. I don't have time to poke further right now. I spent some more time analyzing this, and there seem to be two distinct issues: 1. My patch a7212be

Re: [HACKERS] [PATCH] Generic type subscripting

2020-09-20 Thread Dmitry Dolgov
> On Fri, Sep 18, 2020 at 07:23:11PM +0200, Pavel Stehule wrote: > > > In this way (returning an error on a negative indices bigger than the > > number of elements) functionality for assigning via subscripting will be > > already significantly differ from the original one via jsonb_set. Which > > i

Re: problem with RETURNING and update row movement

2020-09-20 Thread Etsuro Fujita
On Mon, Sep 14, 2020 at 10:45 PM Amit Langote wrote: > On Mon, Sep 14, 2020 at 5:56 PM Etsuro Fujita wrote: > > IIUC, I think two issues are discussed in the thread [1]: (a) there is > > currently no way to define the set of meaningful system columns for a > > partitioned table that contains plug

Re: VACUUM PARALLEL option vs. max_parallel_maintenance_workers

2020-09-20 Thread Peter Eisentraut
On 2020-09-19 13:24, Amit Kapila wrote: I think the implemented behavior is wrong. It is the same as what we do for other parallel operations, for example, we limit the number of parallel workers for parallel create index by 'max_parallel_maintenance_workers' and parallel scan operations are li

Re: XversionUpgrade tests broken by postfix operator removal

2020-09-20 Thread Tom Turelinckx
Andrew Dunstan wrote: > For reference, here is the complete hotfix. Applied on skate/snapper, mussurana/tadarida, ibisbill/kittiwake. Best regards, Tom Turelinckx

Re: [POC] Fast COPY FROM command for the table with foreign partitions

2020-09-20 Thread Andrey Lepikhov
16.09.2020 12:10, Amit Langote пишет: On Thu, Sep 10, 2020 at 6:57 PM Andrey V. Lepikhov wrote: On 9/9/20 5:51 PM, Amit Langote wrote: Ok. I rewrited the patch 0001 with the Alexey suggestion. Thank you. Some mostly cosmetic suggestions on that: +bool +checkMultiInsertMode(const ResultRelIn