Re: [HACKERS] Partition-wise aggregation/grouping

2018-03-06 Thread Jeevan Chalke
On Tue, Mar 6, 2018 at 4:59 PM, Ashutosh Bapat < ashutosh.ba...@enterprisedb.com> wrote: > Hi Jeevan, > I am back reviewing this. Here are some comments. > > @@ -1415,7 +1413,8 @@ add_paths_to_append_rel(PlannerInfo *root, > RelOptInfo *rel, > * the unparameterized Append path we are con

Re: Re: [HACKERS] Subscription code improvements

2018-03-06 Thread David Steele
Hi Masahiko, On 1/30/18 5:00 AM, Masahiko Sawada wrote: > On Fri, Jan 26, 2018 at 11:41 AM, Peter Eisentraut > wrote: >> On 1/24/18 02:33, Masahiko Sawada wrote: >>> Thank you for notification. Since it seems to me that no one is >>> interested in this patch, it would be better to close out this

Re: [PATCH] Atomic pgrename on Windows

2018-03-06 Thread Alexander Korotkov
On Tue, Mar 6, 2018 at 5:11 PM, David Steele wrote: > On 3/6/18 9:06 AM, Alexander Korotkov wrote: > > > > On Tue, Mar 6, 2018 at 5:04 PM, David Steele > > wrote: > > > > On 1/20/18 10:13 AM, Magnus Hagander wrote: > > > > > > Unlinking it first seems dang

Re: [PATCH] Atomic pgrename on Windows

2018-03-06 Thread David Steele
On 3/6/18 9:06 AM, Alexander Korotkov wrote: > > On Tue, Mar 6, 2018 at 5:04 PM, David Steele > wrote: > > On 1/20/18 10:13 AM, Magnus Hagander wrote: > > > > Unlinking it first seems dangerous, as pointed out by Andres. > > > > What about first tr

Re: JIT compiling with LLVM v11

2018-03-06 Thread Peter Eisentraut
On 3/6/18 04:39, Andres Freund wrote: > I did, and reproduced. Turned out I just missed the error in the above > test. > > The bug was caused by one ifdef in get_LifetimeEnd() being wrong > (function is is overloaded starting in 5 rather than 4). The comment > above it even had it right... OK, it

Re: Re: [PATCH] Atomic pgrename on Windows

2018-03-06 Thread Alexander Korotkov
Hi, David! On Tue, Mar 6, 2018 at 5:04 PM, David Steele wrote: > On 1/20/18 10:13 AM, Magnus Hagander wrote: > > > > On Tue, Nov 28, 2017 at 2:47 AM, Michael Paquier > > mailto:michael.paqu...@gmail.com>> wrote: > > > > On Mon, Nov 27, 2017 at 3:28 PM, Alexander Korotkov > > mailto:a.kor

Re: Contention preventing locking

2018-03-06 Thread Amit Kapila
On Mon, Mar 5, 2018 at 1:26 PM, Konstantin Knizhnik wrote: > > On 03.03.2018 16:44, Amit Kapila wrote: >> >> On Thu, Mar 1, 2018 at 1:22 PM, Konstantin Knizhnik >> wrote: >>> >>> On 28.02.2018 16:32, Amit Kapila wrote: On Mon, Feb 26, 2018 at 8:26 PM, Konstantin Knizhnik wrote: >>

Re: Re: [PATCH] Atomic pgrename on Windows

2018-03-06 Thread David Steele
Hi Alexander, On 1/20/18 10:13 AM, Magnus Hagander wrote: > > On Tue, Nov 28, 2017 at 2:47 AM, Michael Paquier > mailto:michael.paqu...@gmail.com>> wrote: > > On Mon, Nov 27, 2017 at 3:28 PM, Alexander Korotkov > mailto:a.korot...@postgrespro.ru>> wrote: > > Attached patch atomic-pgr

Re: [HACKERS] Another oddity in handling of WCO constraints in postgres_fdw

2018-03-06 Thread Arthur Zakirov
On Tue, Mar 06, 2018 at 08:09:50PM +0900, Etsuro Fujita wrote: > Agreed. I added a comment to that function. I think that that comment in > combination with changes to the FDW docs in the patch would help FDW authors > understand why that is needed. Please find attached an updated version of > t

Re: General purpose hashing func in pgbench

2018-03-06 Thread Ildar Musin
Hello Teodor, Thank you for reviewing this patch. On 06.03.2018 15:53, Teodor Sigaev wrote: Patch applies, compiles, pgbench & global "make check" ok, doc built ok. Agree. If I understand upthread correctly, implementation of Murmur hash algorithm based on Austin Appleby work https://github.

Re: All Taxi Services need Index Clustered Heap Append

2018-03-06 Thread Komяpa
вт, 6 мар. 2018 г. в 4:57, Craig Ringer : > On 3 March 2018 at 00:30, Darafei "Komяpa" Praliaskouski > wrote: > > >> I gave this all some thought and it looks like it all could have not >> happened if Postgres was able to cluster heap insertions by (id, ts) index. >> We're ok with synchronuous_co

cannot drop replication slot if server is running in single-user mode

2018-03-06 Thread tushar
Hi, I found that if server is running in single-user mode , there we can create replication slot but cannot drop it . backend> SELECT * FROM pg_create_physical_replication_slot('p'); 2018-03-06 13:20:03.441 GMT [14869] LOG:  statement: SELECT * FROM pg_create_physical_replication_slot('p');

Re: pgbench - allow to specify scale as a size

2018-03-06 Thread Peter Eisentraut
On 3/4/18 04:09, Fabien COELHO wrote: > So ISTM that the patch is dead because it is somehow necessarily > imprecise. People will continue to do some wild guessing on how to > translate scale to anything related to size. I think so. > Conclusion: mark the patch as rejected? OK -- Peter Eisen

Re: using index or check in ALTER TABLE SET NOT NULL

2018-03-06 Thread Sergei Kornilov
Hello thank you for review! > Adding check constraint will also force the full table scan. So I think > it would be better to rephrased it as follows: Agree. I updated docs in new attached patch slightly different > Regarding regression tests it may be useful to set client_min_messages > to 'debu

Re: BUGFIX: standby disconnect can corrupt serialized reorder buffers

2018-03-06 Thread Petr Jelinek
On 06/03/18 09:37, Craig Ringer wrote: > > Revised patch attached. > > I have _not_ rewritten to use sscanf yet. I'll do that next, so you > can choose the fewer-changes patch for backpatching if desired.  > > > ... and I'm not convinced it's really an improvement. > >         uint

Re: All Taxi Services need Index Clustered Heap Append

2018-03-06 Thread Komяpa
пн, 5 мар. 2018 г. в 19:48, Ants Aasma : > On Mon, Mar 5, 2018 at 2:11 PM, Darafei "Komяpa" Praliaskouski > wrote: > >> This approach mixes well with hash > >> partitioning. It would be neat indeed if PostgreSQL do something > >> equivalent on its own, and pluggable storage work being done could

Re: General purpose hashing func in pgbench

2018-03-06 Thread Teodor Sigaev
Patch applies, compiles, pgbench & global "make check" ok, doc built ok. Agree. If I understand upthread correctly, implementation of Murmur hash algorithm based on Austin Appleby work https://github.com/aappleby/smhasher/blob/master/src/MurmurHash2.cpp If so, I have notice and objections:

Re: Faster inserts with mostly-monotonically increasing values

2018-03-06 Thread Claudio Freire
On Tue, Mar 6, 2018 at 9:06 AM, Simon Riggs wrote: >> Simon had raised concerns about DESC indexes and whether we need to do the >> checks for leftmost page in that case. I haven't yet figured out if DESC >> indexes are actually stored in the reverse order. I am gonna look at that >> too. > > No,

Re: committing inside cursor loop

2018-03-06 Thread Ildus Kurbangaliev
On Tue, 20 Feb 2018 09:11:50 -0500 Peter Eisentraut wrote: > Here is a patch that allows COMMIT inside cursor loops in PL/pgSQL. > As alluded to in earlier threads, this is done by converting such > cursors to holdable automatically. A special flag "auto-held" marks > such cursors, so we know to

Re: inserts into partitioned table may cause crash

2018-03-06 Thread Etsuro Fujita
Hi Amit, (2018/03/06 15:28), Amit Langote wrote: On 2018/03/05 22:00, Etsuro Fujita wrote: An alternative fix for this would be to handle the set/reset of estate->es_result_relation_info in a higher level ie, ExecModifyTable, like the attached: Your patch seems like a good cleanup overall, f

Re: Faster inserts with mostly-monotonically increasing values

2018-03-06 Thread Simon Riggs
On 6 March 2018 at 04:40, Pavan Deolasee wrote: > > > On Tue, Mar 6, 2018 at 7:29 AM, Peter Geoghegan wrote: >> >> On Mon, Mar 5, 2018 at 5:48 PM, Claudio Freire >> wrote: >> >> > I believe PKs are a prime candidate for this optimization, and >> > expecting it to apply only when no concurrency i

Re: Fwd: [BUGS] pg_trgm word_similarity inconsistencies or bug

2018-03-06 Thread Teodor Sigaev
I agree with Teodor (upthread, not quoted here) that the documentation could use some editing. I started to do it myself, but quickly realized I have no knowledge of the content. I'm afraid I would destroy the meaning while updating the grammar. Anyone understand the subject matter well enough

Re: [HACKERS] make async slave to wait for lsn to be replayed

2018-03-06 Thread Simon Riggs
On 6 March 2018 at 11:24, Dmitry Ivanov wrote: >> In PG11, I propose the following command, sticking mostly to Ants' >> syntax, and allowing to wait for multiple events before it returns. It >> doesn't hold snapshot and will not get cancelled by Hot Standby. >> >> WAIT FOR event [, event ...] opti

Re: Faster inserts with mostly-monotonically increasing values

2018-03-06 Thread Claudio Freire
On Tue, Mar 6, 2018 at 1:45 AM, Peter Geoghegan wrote: > On Mon, Mar 5, 2018 at 7:10 PM, Claudio Freire wrote: >>> Introducing any case that allows us to land on a recycled page, and >>> reason that it must at least not be the page we were looking for based >>> on *any* criteria about the page it

Re: [HACKERS] Partition-wise aggregation/grouping

2018-03-06 Thread Ashutosh Bapat
Hi Jeevan, I am back reviewing this. Here are some comments. @@ -1415,7 +1413,8 @@ add_paths_to_append_rel(PlannerInfo *root, RelOptInfo *rel, * the unparameterized Append path we are constructing for the parent. * If not, there's no workable unparameterized path. */

Re: [HACKERS] make async slave to wait for lsn to be replayed

2018-03-06 Thread Dmitry Ivanov
In PG11, I propose the following command, sticking mostly to Ants' syntax, and allowing to wait for multiple events before it returns. It doesn't hold snapshot and will not get cancelled by Hot Standby. WAIT FOR event [, event ...] options event is LSN value TIMESTAMP value options TIMEOUT dela

Re: [HACKERS] make async slave to wait for lsn to be replayed

2018-03-06 Thread Ivan Kartyshov
Andres Freund писал 2018-03-02 03:47: On 2018-02-02 19:41:37 +, Simon Riggs wrote: On 2 February 2018 at 18:46, Robert Haas wrote: > On Fri, Feb 2, 2018 at 3:46 AM, Simon Riggs wrote: >> In PG11, I propose the following command, sticking mostly to Ants' >> syntax, and allowing to wait for

Re: [HACKERS] Another oddity in handling of WCO constraints in postgres_fdw

2018-03-06 Thread Etsuro Fujita
(2018/03/06 1:57), Arthur Zakirov wrote: IMHO, it is worth to add more explaining comment into deparseReturningList, why it is necessary to merge WCO attributes to RETURNING clause. You already noted it in the thread. I think it could confuse someone who not very familiar how RETURNING is related

Re: IndexJoin memory problem using spgist and boxes

2018-03-06 Thread Anton Dignös
>> The better alternative may be to have two temporary memory contexts, >> one per-tuple for calling the inner consistent method and one >> per-index-scan for the traversal memory. > > > Yes, this seems to be a better way of fixing the problem without introducing > regressions mentioned by Tom. We'

Re: [HACKERS] Partition-wise aggregation/grouping

2018-03-06 Thread Jeevan Chalke
On Tue, Mar 6, 2018 at 2:29 AM, Robert Haas wrote: > On Mon, Mar 5, 2018 at 3:56 AM, Jeevan Chalke > wrote: > > However, to perform Gather or Gather Merge once we have all partial paths > > ready, and to avoid too many existing code rearrangement, I am calling > > try_partitionwise_grouping() be

Re: constraint exclusion and nulls in IN (..) clause

2018-03-06 Thread Amit Langote
On 2018/03/06 19:16, Emre Hasegeli wrote: >> Hmm, state->next refers to two different pointer values on line 1 and line >> 2. It may end up being set to NULL on line 1. Am I missing something? > > True, lnext(state->next) can set it to NULL. I confused by the below > code on the same function d

Re: constraint exclusion and nulls in IN (..) clause

2018-03-06 Thread Emre Hasegeli
> Hmm, state->next refers to two different pointer values on line 1 and line > 2. It may end up being set to NULL on line 1. Am I missing something? True, lnext(state->next) can set it to NULL. I confused by the below code on the same function doing the steps in reverse order. With this cleare

Re: constraint exclusion and nulls in IN (..) clause

2018-03-06 Thread Amit Langote
On 2018/03/06 18:46, Emre Hasegeli wrote: >> Patch teaches it to ignore nulls when it's known that the operator being >> used is strict. It is harmless and has the benefit that constraint >> exclusion gives an answer that is consistent with what actually running >> such a qual against a table's ro

Re: constraint exclusion and nulls in IN (..) clause

2018-03-06 Thread Emre Hasegeli
> Patch teaches it to ignore nulls when it's known that the operator being > used is strict. It is harmless and has the benefit that constraint > exclusion gives an answer that is consistent with what actually running > such a qual against a table's rows would do. Yes, I understood that. I just

Re: ALTER TABLE ADD COLUMN fast default

2018-03-06 Thread David Rowley
On 6 March 2018 at 22:40, David Rowley wrote: > Okay, it looks like the patch should disable physical tlists when > there's a missing column the same way as we do for dropped columns. > Patch attached. Please disregard the previous patch in favour of the attached. -- David Rowley

Re: WIP Patch: Pgbench Serialization and deadlock errors

2018-03-06 Thread Marina Polyakova
On 05-03-2018 18:21, David Steele wrote: Hello Marina, Hello, David! On 1/12/18 12:01 PM, Marina Polyakova wrote: ... This patch was marked Waiting on Author on Jan 8 and no new patch was submitted before this commitfest. I think we should mark this patch as Returned with Feedback. I'm

Re: ALTER TABLE ADD COLUMN fast default

2018-03-06 Thread David Rowley
On 1 March 2018 at 11:49, Andrew Dunstan wrote: > On Wed, Feb 28, 2018 at 5:39 AM, Andres Freund wrote: >> On 2018-02-27 14:29:44 +1030, Andrew Dunstan wrote: >>> Profiling through timer interrupt >>> samples %image name symbol name >>> 2258428.5982 postgres

Re: JIT compiling with LLVM v11

2018-03-06 Thread Andres Freund
On 2018-03-05 14:01:05 -0800, Andres Freund wrote: > On 2018-03-05 13:36:04 -0800, Andres Freund wrote: > > On 2018-03-05 16:19:52 -0500, Peter Eisentraut wrote: > > > Testing 0732ee73cf3ffd18d0f651376d69d4798d351ccc on Debian testing ... > > > > > > The build works out of the box with whatever th

Re: [HACKERS] PoC: full merge join on comparison clause

2018-03-06 Thread Alexander Kuzmenkov
On 05.03.2018 08:30, Ashutosh Bapat wrote: But creating such patches using git format-patch (with -v as some suggest) really helps in general. Thanks for the advice. I heard about this workflow, but never used it myself. Perhaps it's time to try it. -- Alexander Kuzmenkov Postgres Professi

Re: INOUT parameters in procedures

2018-03-06 Thread Pavel Stehule
2018-03-05 19:38 GMT+01:00 Peter Eisentraut < peter.eisentr...@2ndquadrant.com>: > On 3/5/18 11:00, Pavel Stehule wrote: > > I am looking on attached code, and it looks pretty well. Can be really > > nice if this code will be part of release 11, because it is very > > interesting, important featur

Re: WIP: Covering + unique indexes.

2018-03-06 Thread Thomas Munro
On Wed, Jan 31, 2018 at 3:09 AM, Anastasia Lubennikova wrote: > Thank you for reviewing. All mentioned issues are fixed. == Applying patch 0002-covering-btree_v4.patch... 1 out of 1 hunk FAILED -- saving rejects to file src/backend/access/nbtree/README.rej 1 out of 1 hunk FAILED -- saving rejects

Re: MCV lists for highly skewed distributions

2018-03-06 Thread John Naylor
On 3/5/18, Dean Rasheed wrote: > Attached is an updated patch. I decided to move the code that > determines the minimum number of occurrences for an MCV list item out > to a separate function. It's not much code, but there's a large > comment to explain its statistical justification, and I didn't

Re: Re: BUGFIX: standby disconnect can corrupt serialized reorder buffers

2018-03-06 Thread Craig Ringer
On 6 March 2018 at 16:07, Craig Ringer wrote: > On 6 March 2018 at 09:58, Craig Ringer wrote: > >> On 5 March 2018 at 23:25, David Steele wrote: >> >>> Hi Craig, >>> >>> On 1/21/18 5:45 PM, Craig Ringer wrote: >>> > On 6 January 2018 at 08:28, Alvaro Herrera >> >

Re: INOUT parameters in procedures

2018-03-06 Thread Pavel Stehule
2018-03-05 19:41 GMT+01:00 Pavel Stehule : > > > 2018-03-05 19:38 GMT+01:00 Peter Eisentraut com>: > >> On 3/5/18 11:00, Pavel Stehule wrote: >> > I am looking on attached code, and it looks pretty well. Can be really >> > nice if this code will be part of release 11, because it is very >> > inte

Re: Re: BUGFIX: standby disconnect can corrupt serialized reorder buffers

2018-03-06 Thread Craig Ringer
On 6 March 2018 at 09:58, Craig Ringer wrote: > On 5 March 2018 at 23:25, David Steele wrote: > >> Hi Craig, >> >> On 1/21/18 5:45 PM, Craig Ringer wrote: >> > On 6 January 2018 at 08:28, Alvaro Herrera > > > wrote: >> > >> > I think this should use ReadDirExt

<    1   2