[Patch] Add a reset_computed_values function in pg_stat_statements

2019-09-01 Thread Pierre Ducroquet
Hello pg_stat_statements is a great tool to track performance issue in live databases, especially when adding interfaces like PoWA on top of it. But so far, tools like PoWA can not track the min_time, max_time, mean_time and sum_var_time of queries : these statistics are cumulated over time,

Re: refactoring - share str2*int64 functions

2019-09-01 Thread Michael Paquier
On Sun, Sep 01, 2019 at 01:57:06PM +0200, Fabien COELHO wrote: > I would put back unlikely() on overflow tests, as there are indeed unlikely > to occur and it may help some compilers, and cannot be harmful. It also > helps the code reader to know that these path are not expected to be taken >

Re: Yet another fast GiST build

2019-09-01 Thread Andrey Borodin
> 30 авг. 2019 г., в 16:44, Andrey Borodin написал(а): > > > How do you think, should I supply GiST-build patch with docs and tests and > add it to CF? Or do we need more design discussion before? PFA v2: now sort support is part of opclass. There's a problem with Z-ordering NaN which

Re: Yet another fast GiST build

2019-09-01 Thread Alexander Korotkov
On Fri, Aug 30, 2019 at 2:44 PM Andrey Borodin wrote: > > 30 авг. 2019 г., в 3:47, Alexander Korotkov > написал(а): > > 1) Binary search in non-leaf pages instead of probing each key is much faster. > > > That's a neat idea, but key union breaks ordering, even for z-order. > for two sets of

Proposal: roll pg_stat_statements into core

2019-09-01 Thread David Fetter
Folks, I'd like to $Subject, on by default, with a switch to turn it off for those really at the outer edges of performance. Some reasons include: - It's broadly useful. - Right now, the barrier for turning it on is quite high. In addition to being non-core, which is already a pretty high

Re: Write visibility map during CLUSTER/VACUUM FULL

2019-09-01 Thread Alexander Korotkov
On Sun, Sep 1, 2019 at 11:07 AM Alexander Korotkov wrote: > This patch have to implement its own check if tuple is allvisible. > But it appears to be possible to simplify this check assuming that all > tuples already past HeapTupleSatisfiesVacuum(), which sets hint bits. Forgot to check tuple

Re: row filtering for logical replication

2019-09-01 Thread Erik Rijkers
hes/0130/logrep_rowfilter/20190901/0005-Row-filtering-for-logical-replication.patch checking file doc/src/sgml/catalogs.sgml Hunk #1 succeeded at 5595 (offset 8 lines). checking file doc/src/sgml/ref/alter_publication.sgml checking file doc/src/sgml/ref/create_publication.sgml checking file src/back

Re: Yet another fast GiST build

2019-09-01 Thread Alexander Korotkov
On Fri, Aug 30, 2019 at 6:28 AM Peter Geoghegan wrote: > On Thu, Aug 29, 2019 at 8:22 PM Alexander Korotkov > wrote: > > Alternatively you can encode size in Z-value. But this increases > > dimensionality of space and decreases efficiency of join. Also, > > spatial join can be made using two

Re: refactoring - share str2*int64 functions

2019-09-01 Thread Fabien COELHO
Michaël, I would put back unlikely() on overflow tests, as there are indeed unlikely to occur and it may help some compilers, and cannot be harmful. It also helps the code reader to know that these path are not expected to be taken often. Hm. I don't agree about that part, and the original

Re: range_agg

2019-09-01 Thread Paul A Jungwirth
> > Btw I have working multirange_{send,recv,in,out} now. . . . Just about all the other operators are done too, but I wonder what symbols people like for union and minus? Range uses + for union. I have working code and tests that adds this: r + mr = mr mr + r = mr mr + mr = mr But I would like

Write visibility map during CLUSTER/VACUUM FULL

2019-09-01 Thread Alexander Korotkov
Hi! I found it weird that CLUSTER/VACUUM FULL don't write visibility map. Attached patch implements writing visibility map in heapam_relation_copy_for_cluster(). I've studied previous attempt to implement this [1]. The main problem of that attempt was usage of existing

Re: refactoring - share str2*int64 functions

2019-09-01 Thread Fabien COELHO
Bonjour Michaël, You are right as well that having symmetry with the signed methods is much better. In order to see the difference, you can just do that with the extension attached, after of course hijacking int.h with some undefs and recompiling the backend and the module: select

Re: [Patch] Add a reset_computed_values function in pg_stat_statements

2019-09-01 Thread Euler Taveira
Em dom, 1 de set de 2019 às 06:04, Pierre Ducroquet escreveu: > > Hello > > pg_stat_statements is a great tool to track performance issue in live > databases, especially when adding interfaces like PoWA on top of it. > But so far, tools like PoWA can not track the min_time, max_time, mean_time >

moonjelly vs tsearch

2019-09-01 Thread Thomas Munro
Hi, News from Fabien's bleeding edge compiler zoo: apparently GCC 10 20190831 thinks the tsearch test should produce different output than 20190824 did. It looks like the parsing of question marks change... I can't wait for next week's installment. -- Thomas Munro https://enterprisedb.com

Re: Proposal: roll pg_stat_statements into core

2019-09-01 Thread David Fetter
On Sun, Sep 01, 2019 at 08:12:15PM +0200, Pavel Stehule wrote: > Hi > > ne 1. 9. 2019 v 20:00 odesílatel David Fetter napsal: > > > Folks, > > > > I'd like to $Subject, on by default, with a switch to turn it off for > > those really at the outer edges of performance. Some reasons include: > >

RE: SIGQUIT on archiver child processes maybe not such a hot idea?

2019-09-01 Thread Tsunakawa, Takayuki
From: Tom Lane [mailto:t...@sss.pgh.pa.us] > After investigation, the mechanism that's causing that is that the > src/test/recovery/t/010_logical_decoding_timelines.pl test shuts > down its replica server with a mode-immediate stop, which causes > that postmaster to shut down all its children with

Re: POC: Cleaning up orphaned files using undo logs

2019-09-01 Thread Thomas Munro
On Fri, Aug 30, 2019 at 8:27 PM Kuntal Ghosh wrote: > I'm getting the following assert failure while performing the recovery > with the same. > "TRAP: FailedAssertion("slot->meta.status == UNDO_LOG_STATUS_FULL", > File: "undolog.c", Line: 997)" > > I found that we don't emit an WAL record when we

Bug in GiST paring heap comparator

2019-09-01 Thread Alexander Korotkov
Hi! Andrey Borodin noticed me that results of some KNN-GIST tests are obviously wrong and don't match results of sort node. SELECT * FROM point_tbl ORDER BY f1 <-> '0,1'; f1 --- (10,10) (NaN,NaN) (0,0) (1e-300,-1e-300) (-3,4) (-10,0) (-5,-12) (5.1,34.5)

Re: Bug in GiST paring heap comparator

2019-09-01 Thread Andrey Borodin
> 2 сент. 2019 г., в 9:54, Alexander Korotkov > написал(а): > > It appears to be related to implementation of comparison function in > pairing heap used as priority queue for KNN. It used plain float > comparison, which doesn't handle Inf and Nan values well. Attached > patch replaced it

Re: refactoring - share str2*int64 functions

2019-09-01 Thread Michael Paquier
On Sun, Sep 01, 2019 at 08:07:06PM +0200, Fabien COELHO wrote: > They allow to quickly do performance tests, for me it is useful to keep it > around, but you are the committer, you do as you feel. If there are more voices for having that in core, we could consider it. For now I have added that

Re: REL_12_STABLE crashing with assertion failure in ExtractReplicaIdentity

2019-09-01 Thread Tom Lane
I wrote: > As far as 4) goes, I think the code in ExtractReplicaIdentity is pretty > duff anyway, because it doesn't bother to check for the defined failure > return for RelationIdGetRelation. But if we're concerned about the > cost of recalculating this stuff per-row, couldn't we cache it a

Re: Proposal: roll pg_stat_statements into core

2019-09-01 Thread Tom Lane
David Fetter writes: > - It's broadly useful. Maybe. Whether it can be argued that it's so broadly useful as to justify being on-by-default is not clear. > - Right now, the barrier for turning it on is quite high. In addition > to being non-core, which is already a pretty high barrier at a

Re: safe to overload objectSubId for a type?

2019-09-01 Thread Tom Lane
Chapman Flack writes: > I don't mean "overload objectSubId" in any ObjectAddress that PG code > would ever see. I am only thinking of a data structure of my own that > is ObjectAddress-like and has all three components available all the > time, and for an object that's a type, I would find it

Re: Proposal: roll pg_stat_statements into core

2019-09-01 Thread Pavel Stehule
Hi ne 1. 9. 2019 v 20:00 odesílatel David Fetter napsal: > Folks, > > I'd like to $Subject, on by default, with a switch to turn it off for > those really at the outer edges of performance. Some reasons include: > > - It's broadly useful. > - Right now, the barrier for turning it on is quite

Re: Proposal: roll pg_stat_statements into core

2019-09-01 Thread Pavel Stehule
ne 1. 9. 2019 v 20:48 odesílatel David Fetter napsal: > On Sun, Sep 01, 2019 at 08:12:15PM +0200, Pavel Stehule wrote: > > Hi > > > > ne 1. 9. 2019 v 20:00 odesílatel David Fetter napsal: > > > > > Folks, > > > > > > I'd like to $Subject, on by default, with a switch to turn it off for > > >

Re: moonjelly vs tsearch

2019-09-01 Thread Fabien COELHO
News from Fabien's bleeding edge compiler zoo: apparently GCC 10 20190831 thinks the tsearch test should produce different output than 20190824 did. It looks like the parsing of question marks change... Indeed, that looks pretty strange. I can't wait for next week's installment. I'll

Re: REL_12_STABLE crashing with assertion failure in ExtractReplicaIdentity

2019-09-01 Thread Tom Lane
Andres Freund writes: > On 2019-08-17 01:43:45 -0400, Tom Lane wrote: >> Yeah ... see the discussion leading up to 9c703c169, >> https://www.postgresql.org/message-id/flat/19465.1541636036%40sss.pgh.pa.us >> We didn't pull the trigger on removing the CMD_DELETE exception here, >> but I think the

Re: row filtering for logical replication

2019-09-01 Thread Euler Taveira
Em dom, 1 de set de 2019 às 06:09, Erik Rijkers escreveu: > > The first 4 of these apply without error, but I can't get 0005 to apply. > This is what I use: > Erik, I generate a new patch set with patience diff algorithm. It seems it applies cleanly. -- Euler Taveira

Re: XPRS

2019-09-01 Thread Thomas Munro
On Sat, Aug 24, 2019 at 3:19 AM Tomas Vondra wrote: > > Although “The Wei Hong Optimizer” was designed in the context of > > Postgres, it became the standard approach for many of the parallel > > query optimizers in industry." > > I assume this quote is from 30 years ago. I wonder if the claim is

safe to overload objectSubId for a type?

2019-09-01 Thread Chapman Flack
Hi, I don't mean "overload objectSubId" in any ObjectAddress that PG code would ever see. I am only thinking of a data structure of my own that is ObjectAddress-like and has all three components available all the time, and for an object that's a type, I would find it handy to stash a typmod

pg_basebackup -F t fails when fsync spends more time than tcp_user_timeout

2019-09-01 Thread r.takahash...@fujitsu.com
Hi pg_basebackup -F t fails when fsync spends more time than tcp_user_timeout in following environment. [Environment] Postgres 13dev (master branch) Red Hat Enterprise Postgres 7.4 [Error] $ pg_basebackup -F t --progress --verbose -h -D pg_basebackup: initiating base backup, waiting for

Re: REL_12_STABLE crashing with assertion failure in ExtractReplicaIdentity

2019-09-01 Thread Amit Langote
On Mon, Sep 2, 2019 at 6:31 AM Tom Lane wrote: > I wrote: > > As far as 4) goes, I think the code in ExtractReplicaIdentity is pretty > > duff anyway, because it doesn't bother to check for the defined failure > > return for RelationIdGetRelation. But if we're concerned about the > > cost of

Re: [HACKERS] advanced partition matching algorithm for partition-wise join

2019-09-01 Thread amul sul
Hi Fujita San, Please find my comments inline below: On Wed, Aug 28, 2019 at 3:52 PM Etsuro Fujita wrote: > On Fri, Aug 16, 2019 at 10:25 PM Etsuro Fujita > wrote: > > [... skipped ..] > > About the attached: > > * The attached patch modified try_partitionwise_join() so that we call >

Re: Should we add xid_current() or a int8->xid cast?

2019-09-01 Thread Thomas Munro
On Fri, Aug 2, 2019 at 10:42 PM Thomas Munro wrote: > On Thu, Jul 25, 2019 at 1:11 PM Thomas Munro wrote: > > On Thu, Jul 25, 2019 at 12:42 PM Tom Lane wrote: > > > Andres Freund writes: > > > > On 2019-07-24 20:34:39 -0400, Tom Lane wrote: > > > >> Yeah, I would absolutely NOT recommend that