Re: Refactor parse analysis of EXECUTE command

2019-11-03 Thread Peter Eisentraut
On 2019-11-02 16:00, Tom Lane wrote: Peter Eisentraut writes: This patch moves the parse analysis component of ExecuteQuery() and EvaluateParams() into a new transformExecuteStmt() that is called from transformStmt(). Uhmm ... no actual patch attached? Oops, here it is. -- Peter Eisentraut

Re: cost based vacuum (parallel)

2019-11-03 Thread Komяpa
> > > This is somewhat similar to a memory usage problem with a > parallel query where each worker is allowed to use up to work_mem of > memory. We can say that the users using parallel operation can expect > more system resources to be used as they want to get the operation > done faster, so we a

Re: [HACKERS] Block level parallel vacuum

2019-11-03 Thread Masahiko Sawada
On Mon, 4 Nov 2019 at 14:02, Amit Kapila wrote: > > On Fri, Nov 1, 2019 at 2:21 PM Masahiko Sawada wrote: > > > > I think that two approaches make parallel vacuum worker wait in > > different way: in approach(a) the vacuum delay works as if vacuum is > > performed by single process, on the other

Re: pglz performance

2019-11-03 Thread Andrey Borodin
Hi Tels! Thanks for your interest in fast decompression. > 3 нояб. 2019 г., в 12:24, Tels написал(а): > > I wonder if you agree and what would happen if you try this variant on your > corpus tests. I've tried some different optimization for literals. For example loop unrolling[0] and literals

cost based vacuum (parallel)

2019-11-03 Thread Amit Kapila
For parallel vacuum [1], we were discussing what is the best way to divide the cost among parallel workers but we didn't get many inputs apart from people who are very actively involved in patch development. I feel that we need some more inputs before we finalize anything, so starting a new thread.

Re: [HACKERS] Block level parallel vacuum

2019-11-03 Thread Dilip Kumar
On Mon, Nov 4, 2019 at 10:32 AM Amit Kapila wrote: > > On Fri, Nov 1, 2019 at 2:21 PM Masahiko Sawada wrote: > > > > I think that two approaches make parallel vacuum worker wait in > > different way: in approach(a) the vacuum delay works as if vacuum is > > performed by single process, on the oth

Re: [HACKERS] Block level parallel vacuum

2019-11-03 Thread Dilip Kumar
On Mon, Nov 4, 2019 at 10:45 AM Amit Kapila wrote: > > On Sun, Nov 3, 2019 at 9:49 AM Dilip Kumar wrote: > > > > On Fri, Nov 1, 2019 at 2:21 PM Masahiko Sawada > > wrote: > > > > > > > > > I think that two approaches make parallel vacuum worker wait in > > > different way: in approach(a) the va

Re: [HACKERS] Block level parallel vacuum

2019-11-03 Thread Amit Kapila
On Sun, Nov 3, 2019 at 9:49 AM Dilip Kumar wrote: > > On Fri, Nov 1, 2019 at 2:21 PM Masahiko Sawada wrote: > > > > > > I think that two approaches make parallel vacuum worker wait in > > different way: in approach(a) the vacuum delay works as if vacuum is > > performed by single process, on the

Re: Can avoid list_copy in recomputeNamespacePath() conditionally?

2019-11-03 Thread amul sul
On Sat, Nov 2, 2019 at 8:01 PM Tom Lane wrote: > amul sul writes: > > I wondered can we have a shortcut somewhat similar to following POC > > in recomputeNamespacePath () when the recomputed path is the same as the > > previous baseSearchPath/activeSearchPath : > > + /* TODO: POC */ > > + if

Re: [HACKERS] Block level parallel vacuum

2019-11-03 Thread Amit Kapila
On Fri, Nov 1, 2019 at 2:21 PM Masahiko Sawada wrote: > > I think that two approaches make parallel vacuum worker wait in > different way: in approach(a) the vacuum delay works as if vacuum is > performed by single process, on the other hand in approach(b) the > vacuum delay work for each workers

Re: Allow superuser to grant passwordless connection rights on postgres_fdw

2019-11-03 Thread Stephen Frost
Greetings, * Andrew Dunstan (andrew.duns...@2ndquadrant.com) wrote: > On 11/1/19 12:58 PM, Robert Haas wrote: > > On Thu, Oct 31, 2019 at 4:58 PM Andrew Dunstan > > wrote: > >> This patch allows the superuser to grant passwordless connection rights > >> in postgres_fdw user mappings. > > This is

Re: Collation versioning

2019-11-03 Thread Thomas Munro
On Fri, Nov 1, 2019 at 2:21 AM Julien Rouhaud wrote: > Are you planning to continue working on it? For the record, that's > something needed to be able to implement a filter in REINDEX command > [1]. Bonjour Julien, Unfortunately I haven't had time to work on it seriously, but here's a quick re

TAP tests aren't using the magic words for Windows file access

2019-11-03 Thread Tom Lane
Buildfarm member drongo has been failing the pg_ctl regression test pretty often. I happened to look closer at what's happening, and it's this: could not read "C:/prog/bf/root/HEAD/pgsql.build/src/bin/pg_ctl/tmp_check/t_004_logrotate_primary_data/pgdata/current_logfiles": Permission denied at C

Re: Binary support for pgoutput plugin

2019-11-03 Thread Thomas Munro
On Thu, Oct 31, 2019 at 3:03 AM Dave Cramer wrote: > Ok, I've rebased and reverted logicalrep_read_insert Hi Dave, >From the code style police (actually just from cfbot, which is set up to complain about declarations after statements, a bit of C99 we aren't ready for): proto.c:557:6: error: ISO

Re: New SQL counter statistics view (pg_stat_sql)

2019-11-03 Thread Thomas Munro
On Thu, Oct 17, 2019 at 3:22 PM Smith, Peter wrote: > We have resurrected this 2 year old "SQL statements statistics counter" > proposal from Hari. > > The attached patch addresses the previous review issues. Hi, No comment on the patch but I noticed that the documentation changes don't build.

Re: [HACKERS] Block level parallel vacuum

2019-11-03 Thread Amit Kapila
On Mon, Oct 28, 2019 at 1:52 PM Dilip Kumar wrote: > > On Mon, Oct 28, 2019 at 12:20 PM Amit Kapila wrote: > > > > On Sun, Oct 27, 2019 at 12:52 PM Dilip Kumar wrote: > > > > > > On Fri, Oct 25, 2019 at 9:19 PM Masahiko Sawada > > > wrote: > > > > > > > > > > > I haven't yet read the new set o

Re: SimpleLruTruncate() mutual exclusion

2019-11-03 Thread Thomas Munro
On Thu, Aug 1, 2019 at 6:51 PM Noah Misch wrote: > vac_truncate_clog() instance 1 starts, considers segment ABCD eligible to > unlink > vac_truncate_clog() instance 2 starts, considers segment ABCD eligible to > unlink > vac_truncate_clog() instance 1 unlinks segment ABCD > vac_truncate_clog() i

Re: fe-utils - share query cancellation code

2019-11-03 Thread Thomas Munro
On Sat, Nov 2, 2019 at 10:38 AM Fabien COELHO wrote: > Attached patch v4 does it. Hi Fabien, It looks like don't define sigint_interrupt_jmp and sigint_interrupt_enabled on Windows, yet they are still declared and referenced? command.obj : error LNK2001: unresolved external symbol sigint_interr

Re: Log statement sample - take two

2019-11-03 Thread Tomas Vondra
On Sat, Oct 19, 2019 at 05:02:01PM +0200, Adrien Nayrat wrote: Hello, This patch propose a new way to sample statement to logs. As a reminder, this feature was committed in PG12[1] then reverted[2] after the proposition of log_statement_sample_limit[3] The first implementation added a new GUC

Re: let's make the list of reportable GUCs configurable (was Re: Add %r substitution for psql prompts to show recovery status)

2019-11-03 Thread Thomas Munro
On Wed, Oct 16, 2019 at 6:49 PM Dave Cramer wrote: > Here's an updated patch that addresses some of Andres' concerns specifically > does not use strtok. Hi Dave, I think you need to s/strncasecmp/pg_strncasecmp/ to make this build on Windows. https://ci.appveyor.com/project/postgresql-cfbot/po

Re: Getting psql to redisplay command after \e

2019-11-03 Thread Tom Lane
Fabien COELHO writes: >> I did experiment with trying to do that, but I couldn't get it to work, >> even with the single version of libreadline I had at hand. It appears >> to me that readline() starts by clearing the internal buffer. Even if >> we could persuade it to work in a particular re

Re: Parallel leader process info in EXPLAIN

2019-11-03 Thread Thomas Munro
On Mon, Nov 4, 2019 at 12:11 PM Thomas Munro wrote: > I guess I thought of that as a debugging feature and took it out > because it was too verbose, but maybe it just needs to be controlled > by the VERBOSE switch. Do you think we should put that back? By which I mean: would you like to send a p

Re: Parallel leader process info in EXPLAIN

2019-11-03 Thread Thomas Munro
On Thu, Oct 31, 2019 at 5:24 AM Melanie Plageman wrote: > On Wed, Oct 23, 2019 at 12:30 AM Thomas Munro wrote: >> Of course there are some more things that could be reported in a >> similar way eventually, such as filter counters and hash join details. > > This made me think about other explain w

Re: Consolidate 'unique array values' logic into a reusable function?

2019-11-03 Thread Thomas Munro
On Tue, Sep 10, 2019 at 11:43 AM Thomas Munro wrote: > Rebased due to bitrot. Spotted one more place to use this, in > src/backend/utils/adt/txid.c. Rebased. I'm planning to commit this soon. 0001-Consolidate-code-that-makes-a-sorted-array-unique-v3.patch Description: Binary data

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

2019-11-03 Thread Thomas Munro
On Tue, Oct 29, 2019 at 5:23 PM btfujiitkp wrote: > > Thomas Munro writes: > >> On Sun, Sep 1, 2019 at 5:04 PM Thomas Munro > >> wrote: > >>> Adding to CF. > > > >> Rebased. An OID clashed so re-roll the dice. Also spotted a typo. > > > > I have some questions in this code. Thanks for looking

Re: BUG #16059: Tab-completion of filenames in COPY commands removes required quotes

2019-11-03 Thread Tom Lane
[ redirecting to -hackers ] I wrote: > Yeah, it seems like a bad idea to override the user's choice to write > a quote, even if one is not formally necessary. I propose the attached. After further experimentation, I concluded that that patch is a bad idea; it breaks a lot of cases that used to w

Re: [PATCH] Include triggers in EXPLAIN

2019-11-03 Thread Tom Lane
=?UTF-8?B?Sm9zZWYgxaBpbcOhbmVr?= writes: > Recently I got few times into situation where I was trying to find out what > is blocking DELETE queries. Running EXPLAIN (even VERBOSE one) wasn't > useful, since the reason was slow trigger (missing index on foreign key > column). I had to create testin

Re: 64 bit transaction id

2019-11-03 Thread Thomas Munro
On Sat, Nov 2, 2019 at 6:15 AM Tomas Vondra wrote: > On Fri, Nov 01, 2019 at 12:05:12PM +0300, Павел Ерёмин wrote: > > Hi. > > sorry for my English. > > I want to once again open the topic of 64 bit transaction id. I did not > > manage to find in the archive of the option that I want to di

function calls optimization

2019-11-03 Thread Andrzej Barszcz
Hi Main goal of this patch is to avoid repeated calls of immutable/stable functions. This patch is against version 10.10. I guess same logic could be implemented up till version 12. --- src/include/nodes/execnodes.h 2019-08-05 23:16:54.0 +0200 +++ src/include/nodes/execnodes.h 2019-11-03 2

Re: Getting psql to redisplay command after \e

2019-11-03 Thread Pavel Stehule
ne 3. 11. 2019 v 20:58 odesílatel Fabien COELHO napsal: > > Hello Tom, > > >> I was suggesting something much simpler than rethinking readline > handling. > >> Does not mean that it is a good idea, but while testing the patch I > would > >> have liked the unfinished line to be in the current edit

Re: Getting psql to redisplay command after \e

2019-11-03 Thread Fabien COELHO
Hello Tom, I was suggesting something much simpler than rethinking readline handling. Does not mean that it is a good idea, but while testing the patch I would have liked the unfinished line to be in the current editing buffer, basically as if I had not typed . I did experiment with trying to

Re: 64 bit transaction id

2019-11-03 Thread Tomas Vondra
On Sun, Nov 03, 2019 at 02:17:15PM +0300, Павел Ерёмин wrote: I completely agree with all of the above. Therefore, the proposed mechanism may entail larger improvements (and not only VACUUM). I think the best think you can do is try implementing this ... I'm afraid the "improvements" essen

[PATCH] Include triggers in EXPLAIN

2019-11-03 Thread Josef Šimánek
Hello! Recently I got few times into situation where I was trying to find out what is blocking DELETE queries. Running EXPLAIN (even VERBOSE one) wasn't useful, since the reason was slow trigger (missing index on foreign key column). I had to create testing entry and run EXPLAIN ANALYZE DELETE to

Re: Index Skip Scan

2019-11-03 Thread Dmitry Dolgov
> On Wed, Sep 25, 2019 at 2:33 AM Dmitry Dolgov <9erthali...@gmail.com> wrote: > v27-0001-Index-skip-scan.patch > > Some random thoughts on this: Thanks a lot for the commentaries! > * Is _bt_scankey_within_page() really doing the right thing within empty > pages? > > It looks like you're accide

Re: [HACKERS] proposal: schema variables

2019-11-03 Thread Pavel Stehule
čt 10. 10. 2019 v 11:41 odesílatel Pavel Stehule napsal: > Hi > > minor change - replace heap_tuple_fetch_attr by detoast_external_attr. > > similar update - heap_open, heap_close was replaced by table_open, table_close Regards Pavel schema_variables-20191103.patch

Re: updating unaccent.rules for Arabic letters

2019-11-03 Thread Tom Lane
kerbrose khaled writes: > I would like to update unaccent.rules file to support Arabic letters. so > could someone help me or tell me how could I add such contribution. I > attached the file including the modifications, only the last 4 lines. Hi! I've got no objection to including Arabic in th

Re: [PATCH] contrib/seg: Fix PG_GETARG_SEG_P definition

2019-11-03 Thread Tom Lane
ilm...@ilmari.org (Dagfinn Ilmari =?utf-8?Q?Manns=C3=A5ker?=) writes: > I just noticed that when contrib/seg was converted to V1 calling > convention (commit 389bb2818f4), the PG_GETARG_SEG_P() macro got defined > in terms of PG_GETARG_POINTER(). But it itself calls DatumGetPointer(), > so shouldn

Re: The flinfo->fn_extra question, from me this time.

2019-11-03 Thread Dent John
> On 3 Nov 2019, at 13:33, Pavel Stehule wrote: > > can be nice, if patch has some regress tests - it is good for memory > refreshing what is target of patch. With a suitably small work_mem constraint, it is possible to show the absence of buffers resulting from the tuplestore. It’ll need some

Re: The flinfo->fn_extra question, from me this time.

2019-11-03 Thread Pavel Stehule
Hi ne 3. 11. 2019 v 12:51 odesílatel Dent John napsal: > (And here’s aforementioned attachment… doh.) > can be nice, if patch has some regress tests - it is good for memory refreshing what is target of patch. Regards Pavel

Re: The flinfo->fn_extra question, from me this time.

2019-11-03 Thread Dent John
(And here’s aforementioned attachment… doh.) pipeline-functionscan-v2.patch Description: Binary data

Re: 64 bit transaction id

2019-11-03 Thread Павел Ерёмин
I completely agree with all of the above. Therefore, the proposed mechanism may entail larger improvements (and not only VACUUM).I can offer the following solution.For VACUUM, create a hash table.VACUUM scanning the table sees that the version (tuple1) has t_ctid filled and refers to the address tu

Re: pglz performance

2019-11-03 Thread Tels
Hello Andrey, On 2019-11-02 12:30, Andrey Borodin wrote: 1 нояб. 2019 г., в 18:48, Alvaro Herrera написал(а): PFA two patches: v4-0001-Use-memcpy-in-pglz-decompression.patch (known as 'hacked' in test_pglz extension) v4-0001-Use-memcpy-in-pglz-decompression-for-long-matches.patch (known as 'ha

Re: [PATCH][DOC] Fix for PREPARE TRANSACTION doc and postgres_fdw message.

2019-11-03 Thread Gilles Darold
Le 02/11/2019 à 08:31, Michael Paquier a écrit : > On Fri, Nov 01, 2019 at 05:29:23PM +0100, Gilles Darold wrote: >> I have attached a patch to the documentation that adds remote tables to >> the list of objects where any operation prevent using a prepared >> transaction, currently it is just notif