Re: POC: postgres_fdw insert batching

2020-11-24 Thread Craig Ringer
On Thu, Oct 8, 2020 at 10:40 AM tsunakawa.ta...@fujitsu.com < tsunakawa.ta...@fujitsu.com> wrote: > > Thank you for picking up this. I'm interested in this topic, too. (As an > aside, we'd like to submit a bulk insert patch for ECPG in the near future.) > > As others referred, Andrey-san's fast

Re: Terminate the idle sessions

2020-11-24 Thread Li Japin
On Nov 24, 2020, at 11:20 PM, David G. Johnston mailto:david.g.johns...@gmail.com>> wrote: On Mon, Nov 23, 2020 at 11:22 PM Li Japin mailto:japi...@hotmail.com>> wrote: How about use “foreign-data wrapper” replace “postgres_fdw”? I don't see much value in avoiding mentioning that specific t

Re: [PoC] Non-volatile WAL buffer

2020-11-24 Thread Tomas Vondra
On 11/25/20 2:10 AM, Ashwin Agrawal wrote: > On Sun, Nov 22, 2020 at 5:23 PM Tomas Vondra > wrote: > >> I'm not entirely sure whether the "pmemdax" (i.e. unpatched instance >> with WAL on PMEM DAX device) is actually safe, but I included it anyway >> to see what difference is. > > I am curious to

Re: About adding a new filed to a struct in primnodes.h

2020-11-24 Thread Andy Fan
On Wed, Nov 25, 2020 at 9:40 AM Tom Lane wrote: > Andy Fan writes: > > What I mean here is something like below. > > What exactly would be the value of that? > > There is work afoot, or at least on people's to-do lists, to mechanize > creation of the outfuncs/readfuncs/etc code directly from the

Re: Strange behavior with polygon and NaN

2020-11-24 Thread Kyotaro Horiguchi
(My mailer seems to have recovered from unresponsiveness.) At Tue, 24 Nov 2020 12:29:41 -0500, Tom Lane wrote in > Kyotaro Horiguchi writes: > > At Fri, 20 Nov 2020 15:57:46 -0500, Tom Lane wrote in > >> I don't much like anything about float8_coef_mul(). > > > I have the same feeling on the

Re: Parallel Inserts in CREATE TABLE AS

2020-11-24 Thread Bharath Rupireddy
On Tue, Nov 24, 2020 at 4:43 PM Hou, Zhijie wrote: > > I'm very interested in this feature, > and I'm looking at the patch, here are some comments. > Thanks for the review. > > How about the following style: > > if(TupIsNull(outerTupleSlot)) > Break; > >

Re: [PATCH] Add features to pg_stat_statements

2020-11-24 Thread Seino Yuki
2020-11-17 01:46 に Fujii Masao さんは書きました: On 2020/11/16 12:22, Seino Yuki wrote: Thanks for updating the patch! +    pgss_info->dealloc = 0; +    SpinLockInit(&pgss_info->mutex); +    Assert(pgss_info->dealloc == 0); Why is this assertion check necessary? It seems not necessary. + 

Re: [PATCH] postgres_fdw connection caching - cause remote sessions linger till the local session exit

2020-11-24 Thread Bharath Rupireddy
On Wed, Nov 25, 2020 at 7:24 AM Craig Ringer wrote: > > A quick thought here. > > Would it make sense to add a hook in the DISCARD ALL implementation that > postgres_fdw can register for? > > There's precedent here, since DISCARD ALL already has the same effect as > SELECT pg_advisory_unlock_all

Re: Removal of currtid()/currtid2() and some table AM cleanup

2020-11-24 Thread Michael Paquier
On Sun, Nov 22, 2020 at 08:11:21PM +0900, Michael Paquier wrote: > Okay, here you go with the attached. If there are any other comments, > please feel free. Hearing nothing, applied this one after going through the ODBC driver code again this morning. Compatibility is exactly the same for currti

Re: Any objections to implementing LogicalDecodeMessageCB for pgoutput?

2020-11-24 Thread Euler Taveira
On Wed, 18 Nov 2020 at 03:04, David Pirotte wrote: > On Fri, Nov 6, 2020 at 7:05 AM Ashutosh Bapat < > ashutosh.bapat@gmail.com> wrote: > >> +/* >> + * Write MESSAGE to stream >> + */ >> +void >> +logicalrep_write_message(StringInfo out, ReorderBufferTXN *txn, >> XLogRecPtr lsn, >> +

Re: Add table access method as an option to pgbench

2020-11-24 Thread Michael Paquier
On Tue, Nov 24, 2020 at 03:32:38PM -0800, David Zhang wrote: > But, providing another option for the end user may not be a bad idea, and it > might make the tests easier at some points. My first thought is that we have no need to complicate pgbench with this option because there is a GUC able to d

Re: About adding a new filed to a struct in primnodes.h

2020-11-24 Thread Tom Lane
Andy Fan writes: > On Wed, Nov 25, 2020 at 9:40 AM Tom Lane wrote: >> What exactly would be the value of that? >> ... > I agree with this, but I don't think there is no value in my suggestion > unless I missed something. Per my current understanding, the code > is too easy to make the datadir in

Re: WIP: WAL prefetch (another approach)

2020-11-24 Thread Thomas Munro
On Thu, Nov 19, 2020 at 10:00 AM Stephen Frost wrote: > * Thomas Munro (thomas.mu...@gmail.com) wrote: > > Hmm. Every time I try to think of a protocol change for the > > restore_command API that would be acceptable, I go around the same > > circle of thoughts about event flow and realise that wh

Re: [PATCH] Add features to pg_stat_statements

2020-11-24 Thread Fujii Masao
On 2020/11/25 12:02, Seino Yuki wrote: 2020-11-17 01:46 に Fujii Masao さんは書きました: On 2020/11/16 12:22, Seino Yuki wrote: Thanks for updating the patch! +    pgss_info->dealloc = 0; +    SpinLockInit(&pgss_info->mutex); +    Assert(pgss_info->dealloc == 0); Why is this assertion c

Re: Deleting older versions in unique indexes to avoid page splits

2020-11-24 Thread Peter Geoghegan
On Tue, Nov 17, 2020 at 12:45 PM Peter Geoghegan wrote: > > I am thinking of two more scenarios that require testing: > > - queue in the table, with a high rate of INSERTs+DELETEs and a long > > transaction. > > I see your point. This is going to be hard to make work outside of > unique indexes,

Re: A few new options for CHECKPOINT

2020-11-24 Thread Michael Paquier
On Wed, Nov 25, 2020 at 01:07:47AM +, tsunakawa.ta...@fujitsu.com wrote: > From: Bossart, Nathan >> It may be useful for backups taken with the "consistent snapshot" >> approach. As noted in the documentation [0], running CHECKPOINT >> before taking the snapshot can reduce recovery time. How

Re: Dereference before NULL check (src/backend/storage/ipc/latch.c)

2020-11-24 Thread Thomas Munro
On Thu, Nov 5, 2020 at 10:47 AM Ranier Vilela wrote: > Em ter., 3 de nov. de 2020 às 22:09, Kyotaro Horiguchi > escreveu: >> If we call WaitLatch(OrSocket) that waits on the latch, it immediately >> returns because the latch is set. If we called ResetLatch before the >> next call to WaitLatch(),

RE: POC: postgres_fdw insert batching

2020-11-24 Thread tsunakawa.ta...@fujitsu.com
From: Tomas Vondra > On 11/24/20 9:45 AM, tsunakawa.ta...@fujitsu.com wrote: > > OTOH, as for the name GetModifyBatchSize() you suggest, I think > GetInsertBatchSize may be better. That is, this API deals with multiple > records in a single INSERT statement. Your GetModifyBatchSize will be > res

Re: About adding a new filed to a struct in primnodes.h

2020-11-24 Thread Andy Fan
On Wed, Nov 25, 2020 at 11:54 AM Tom Lane wrote: > Andy Fan writes: > > On Wed, Nov 25, 2020 at 9:40 AM Tom Lane wrote: > >> What exactly would be the value of that? > >> ... > > > I agree with this, but I don't think there is no value in my suggestion > > unless I missed something. Per my curr

Re: [doc] plan invalidation when statistics are update

2020-11-24 Thread Fujii Masao
On 2020/11/24 23:14, Fujii Masao wrote: On 2020/11/19 14:33, torikoshia wrote: On 2020-11-18 11:35, Fujii Masao wrote: Thanks for your comment! On 2020/11/18 11:04, torikoshia wrote: Hi, AFAIU, when the planner statistics are updated, generic plans are invalidated and PostgreSQL recre

Re: autovac issue with large number of tables

2020-11-24 Thread Masahiko Sawada
On Fri, Sep 4, 2020 at 7:50 PM Kasahara Tatsuhito wrote: > > Hi, > > On Wed, Sep 2, 2020 at 2:10 AM Kasahara Tatsuhito > wrote: > > > I wonder if we could have table_recheck_autovac do two probes of the stats > > > data. First probe the existing stats data, and if it shows the table to > > > be

Re: [doc] plan invalidation when statistics are update

2020-11-24 Thread Andy Fan
On Wed, Nov 25, 2020 at 1:13 PM Fujii Masao wrote: > > > On 2020/11/24 23:14, Fujii Masao wrote: > > > > > > On 2020/11/19 14:33, torikoshia wrote: > >> On 2020-11-18 11:35, Fujii Masao wrote: > >> > >> Thanks for your comment! > >> > >>> On 2020/11/18 11:04, torikoshia wrote: > Hi, > >

Re: A few new options for CHECKPOINT

2020-11-24 Thread Fujii Masao
On 2020/11/25 13:47, Michael Paquier wrote: On Wed, Nov 25, 2020 at 01:07:47AM +, tsunakawa.ta...@fujitsu.com wrote: From: Bossart, Nathan It may be useful for backups taken with the "consistent snapshot" approach. As noted in the documentation [0], running CHECKPOINT before taking the

Re: Remove cache_plan argument comments to ri_PlanCheck

2020-11-24 Thread Amit Kapila
On Tue, Nov 24, 2020 at 7:26 PM Amit Kapila wrote: > > On Tue, Nov 24, 2020 at 4:46 PM Li Japin wrote: > > > > Hi, hackers > > > > I found that the cache_plan argument to ri_PlanCheck already been remove > > since > > 5b7ba75f7ff854003231e8099e3038c7e2eba875. I think we can remove the > > com

Re: [PATCH] LWLock self-deadlock detection

2020-11-24 Thread Craig Ringer
On Tue, Nov 24, 2020 at 10:11 PM Ashutosh Bapat < ashutosh.bapat@gmail.com> wrote: > This looks useful. LWLockCheckSelfDeadlock() could use LWLockHeldByMe > variant instead of copying that code with possibly a change in that > function to return the required information. > Yes, possibly so. I

Re: [Proposal] Global temporary tables

2020-11-24 Thread Pavel Stehule
po 23. 11. 2020 v 10:27 odesílatel 曾文旌 napsal: > > > 2020年11月21日 02:28,Pavel Stehule 写道: > > Hi > > pá 11. 9. 2020 v 17:00 odesílatel 曾文旌 > napsal: > >> I have written the README for the GTT, which contains the GTT >> requirements and design. >> I found that compared to my first email a year ag

RE: POC: postgres_fdw insert batching

2020-11-24 Thread tsunakawa.ta...@fujitsu.com
From: Craig Ringer > I suggest that when developing this, you keep in mind the ongoing work on the > libpq pipelining/batching enhancements, and also the way many interfaces to > foreign data sources support asynchronous, concurrent operations. Yes, thank you, I bear it in mind. I understand

Re: [PATCH] Add features to pg_stat_statements

2020-11-24 Thread Seino Yuki
2020-11-25 13:13 に Fujii Masao さんは書きました: On 2020/11/25 12:02, Seino Yuki wrote: 2020-11-17 01:46 に Fujii Masao さんは書きました: On 2020/11/16 12:22, Seino Yuki wrote: Thanks for updating the patch! +    pgss_info->dealloc = 0; +    SpinLockInit(&pgss_info->mutex); +    Assert(pgss_info->

Re: Libpq support to connect to standby server as priority

2020-11-24 Thread Greg Nancarrow
On Wed, Nov 25, 2020 at 12:07 PM Tom Lane wrote: > > > Here's a v2 that does it like that. > Looks OK to me. Regards, Greg Nancarrow Fujitsu Australia

Re: default result formats setting

2020-11-24 Thread Peter Eisentraut
On 2020-11-16 16:15, Andrew Dunstan wrote: I think this is conceptually OK, although it feels a bit odd. Might it be better to have the values as typename={binary,text} pairs instead of oid={0,1} pairs, which are fairly opaque? That might make things easier for things like UDTs where the oid mig

Re: vac_update_datfrozenxid will raise "wrong tuple length" if pg_database tuple contains toast attribute.

2020-11-24 Thread Michael Paquier
On Wed, Nov 18, 2020 at 06:32:51AM +, Junfeng Yang wrote: > A path is attached co auther by Ashwin Agrawal, the solution is to > fetch the pg_database tuple from disk instead of system cache if > needed. Yeah, we had better fix and I guess backpatch something here. That's annoying. +DROP DAT

Re: autovac issue with large number of tables

2020-11-24 Thread Kasahara Tatsuhito
Hi, On Wed, Nov 25, 2020 at 2:17 PM Masahiko Sawada wrote: > > On Fri, Sep 4, 2020 at 7:50 PM Kasahara Tatsuhito > wrote: > > > > Hi, > > > > On Wed, Sep 2, 2020 at 2:10 AM Kasahara Tatsuhito > > wrote: > > > > I wonder if we could have table_recheck_autovac do two probes of the > > > > stats

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

2020-11-24 Thread Peter Smith
Hi Amit. IIUC the tablesync worker runs in a single transaction. Last week I discovered and described [1] a problem where/if (by unlucky timing) the tablesync worker gets to handle the 2PC PREPARE TRANSACTION then that whole single tx is getting committed, regardless that a COMMIT PREPARED was no

Re: walsender bug: stuck during shutdown

2020-11-24 Thread Fujii Masao
On 2020/11/25 0:07, Alvaro Herrera wrote: Hello, On 2020-Nov-24, Fujii Masao wrote: Thanks for working on this! Could you tell me the discussion thread where Chloe Dives reported the issue to? Sorry I could not find that.. It was not public -- sorry I didn't make that clear. I'd like to

Re: Parallel plans and "union all" subquery

2020-11-24 Thread Luc Vlaming
On 24-11-2020 01:44, Greg Nancarrow wrote: On Tue, Nov 24, 2020 at 2:34 AM Luc Vlaming wrote: Hi, For this problem there is a patch I created, which is registered under https://commitfest.postgresql.org/30/2787/ that should fix this without any workarounds. Maybe someone can take a look at it

Re: abstract Unix-domain sockets

2020-11-24 Thread Peter Eisentraut
On 2020-11-24 02:57, Michael Paquier wrote: On Fri, Nov 20, 2020 at 04:06:43PM +0100, Peter Eisentraut wrote: I think we are getting a bit sidetracked here with the message wording. The reason I looked at this was that "remove socket file and retry" is never an appropriate action with abstract s

Re: abstract Unix-domain sockets

2020-11-24 Thread Peter Eisentraut
On 2020-11-24 16:49, David G. Johnston wrote: On Tue, Nov 24, 2020 at 8:45 AM Peter Eisentraut > wrote: We're subject to whatever the kernel behavior is.  If the kernel doesn't report address conflicts for Unix-domain sockets, then we can't d

<    1   2