Re: Corrupted btree index on HEAD because of covering indexes

2018-04-18 Thread Peter Geoghegan
On Wed, Apr 18, 2018 at 10:29 PM, Teodor Sigaev wrote: > Will see... I'll take a look tomorrow. -- Peter Geoghegan

Re: Excessive PostmasterIsAlive calls slow down WAL redo

2018-04-18 Thread Andres Freund
On April 18, 2018 8:05:50 PM PDT, Thomas Munro wrote: >On Wed, Apr 18, 2018 at 5:04 PM, Thomas Munro > wrote: >> On Wed, Apr 11, 2018 at 10:22 PM, Heikki Linnakangas > wrote: On Tue, Apr 10, 2018 at 12:53 PM, Andres Freund > wrote: > That person said he'd work on adding an equival

Re: WIP: Covering + unique indexes.

2018-04-18 Thread Peter Geoghegan
On Wed, Apr 18, 2018 at 10:47 PM, Teodor Sigaev wrote: > Thank you, pushed. Thanks. I saw another preexisting issue, this time one that has been around since 2007. Commit bc292937 forgot to remove a comment above _bt_insertonpg() (the 'afteritem' stuff ended up being moved to the bottom of _bt_f

Re: Is there a memory leak in commit 8561e48?

2018-04-18 Thread Michael Paquier
On Thu, Apr 19, 2018 at 11:38:09AM +0800, jian.l...@i-soft.com.cn wrote: > in commit 8561e48, _SPI_stack alloc from TopMemoryContext. But > AtEOXact_SPI just set _SPI_stack = NULL. Is this a memory leak? You are right. I can easily see the leak if I use for example a background worker which conn

Re: Problem while updating a foreign table pointing to a partitioned table on foreign server

2018-04-18 Thread Kyotaro HORIGUCHI
At Wed, 18 Apr 2018 13:23:06 +0530, Ashutosh Bapat wrote in > On Wed, Apr 18, 2018 at 9:43 AM, Kyotaro HORIGUCHI > wrote: > > > > Anyway I think we should warn or error out if one nondirect > > update touches two nor more tuples in the first place. > > > > =# UPDATE fplt SET b = (CASE WHEN ran

Re: WIP: Covering + unique indexes.

2018-04-18 Thread Teodor Sigaev
Thank you, pushed. Actually, I see one tiny issue with extra '*' characters here: +* The number of attributes won't be explicitly represented if the +* negative infinity tuple was generated during a page split that +* occurred with a version of Postgres befo

RE: Speedup of relation deletes during recovery

2018-04-18 Thread Tsunakawa, Takayuki
From: Fujii Masao [mailto:masao.fu...@gmail.com] > Yeah, it's worth working on this problem. To decrease the number of scans > of > shared_buffers, you would need to change the order of truncations of files > and > WAL logging. In RelationTruncate(), currently WAL is logged after FSM and > VM > are

Re: [HACKERS] Runtime Partition Pruning

2018-04-18 Thread Amit Langote
Hi David. On 2018/04/19 9:04, David Rowley wrote: > On 19 April 2018 at 03:13, Robert Haas wrote: >> On Mon, Apr 16, 2018 at 10:46 PM, David Rowley >> wrote: >>> The patch does happen to improve performance slightly, but that is >>> most likely due to the caching of the ExprStates rather than th

RE: reloption to prevent VACUUM from truncating empty pages at the end of relation

2018-04-18 Thread Tsunakawa, Takayuki
From: Fujii Masao [mailto:masao.fu...@gmail.com] > a very long time before accessing to the relation. Which would cause the > response-time spikes, for example, I observed such spikes several times > on > the server with shared_buffers = 300GB while running the benchmark. FYI, a long transaction t

Is a modern build system acceptable for older platforms

2018-04-18 Thread Catalin Iacob
There have been several discussions of replacing PG's autoconf + src/tools/msvc system. The last example is happening now at the bottom of the Setting rpath on llvmjit.so thread. I see potentially big advantages to moving but also to PG's conservative approach that keeps it running on edge and old

Re: Corrupted btree index on HEAD because of covering indexes

2018-04-18 Thread Teodor Sigaev
Will see... Michael Paquier wrote: Hi all, I was just testing the VACUUM truncation logic, and bumped into what looks like a corrupted btree index. Here is a reproducer: create table aa (a int primary key, b bool); insert into aa values (generate_series(1,100), false); checkpoint; update a

Corrupted btree index on HEAD because of covering indexes

2018-04-18 Thread Michael Paquier
Hi all, I was just testing the VACUUM truncation logic, and bumped into what looks like a corrupted btree index. Here is a reproducer: create table aa (a int primary key, b bool); insert into aa values (generate_series(1,100), false); checkpoint; update aa set b = false where a > 50; -- D

Re: Truncation failure in autovacuum results in data corruption (duplicate keys)

2018-04-18 Thread Michael Paquier
On Wed, Apr 18, 2018 at 04:49:17PM -0400, Tom Lane wrote: > Just to throw out a possibly-crazy idea: maybe we could fix this by > PANIC'ing if truncation fails, so that we replay the row deletions from > WAL. Obviously this would be intolerable if the case were frequent, > but we've had only two s

RE: Built-in connection pooling

2018-04-18 Thread Tsunakawa, Takayuki
From: Konstantin Knizhnik [mailto:k.knizh...@postgrespro.ru] Oracle, for example, you can create dedicated and non-dedicated backends. > I wonder why we do not want to have something similar in Postgres. Yes, I want it, too. In addition to dedicated and shared server processes, Oracle provides D

Re: Should we add GUCs to allow partition pruning to be disabled?

2018-04-18 Thread Ashutosh Bapat
On Thu, Apr 19, 2018 at 2:54 AM, David Rowley wrote: > If we just did it at plan time then > pre-PREPAREd queries might still prune. That does not seem very > useful if it's being disabled due to the discovery of some bug. > As you have pointed out upthread, that's a problem with every enable_*

Re: Postgres 10 problem with UNION ALL of null value in "subselect"

2018-04-18 Thread Pavel Stehule
2018-04-19 5:01 GMT+02:00 Kyotaro HORIGUCHI : > At Mon, 16 Apr 2018 18:39:24 +0530, Ashutosh Bapat < > ashutosh.ba...@enterprisedb.com> wrote in fg2sub360mg3cbxq1...@mail.gmail.com> > > On Mon, Apr 16, 2018 at 4:10 PM, Martin Swiech > wrote: > > > Hi folks, > > > > > > I got some complex query w

Is there a memory leak in commit 8561e48?

2018-04-18 Thread jian.l...@i-soft.com.cn
in commit 8561e48, _SPI_stack alloc from TopMemoryContext. But AtEOXact_SPI just set _SPI_stack = NULL. Is this a memory leak?

Re: [HACKERS] PATCH: Keep one postmaster monitoring pipe per process

2018-04-18 Thread Thomas Munro
On Wed, Apr 18, 2018 at 6:55 PM, Thomas Munro wrote: > Here's a draft patch that does that. Here's a better one (the previous version could read past the end of the occurred_events array). -- Thomas Munro http://www.enterprisedb.com 0001-Exit-by-default-if-postmaster-dies-v2.patch Description

Re: Excessive PostmasterIsAlive calls slow down WAL redo

2018-04-18 Thread Thomas Munro
On Wed, Apr 18, 2018 at 5:04 PM, Thomas Munro wrote: > On Wed, Apr 11, 2018 at 10:22 PM, Heikki Linnakangas wrote: >>> On Tue, Apr 10, 2018 at 12:53 PM, Andres Freund >>> wrote: That person said he'd work on adding an equivalent of linux' prctl(PR_SET_PDEATHSIG) to FreeBSD. > > Here is

Re: Postgres 10 problem with UNION ALL of null value in "subselect"

2018-04-18 Thread Kyotaro HORIGUCHI
At Mon, 16 Apr 2018 18:39:24 +0530, Ashutosh Bapat wrote in > On Mon, Apr 16, 2018 at 4:10 PM, Martin Swiech > wrote: > > Hi folks, > > > > I got some complex query which works on PostgreSQL 9.6 , but fails on > > PostgreSQL 10. > > > > Version of PostgreSQL: > > PostgreSQL 10.3 on x86_64-app

Re: Adding an LWLockHeldByMe()-like function that reports if any buffer content lock is held

2018-04-18 Thread Peter Geoghegan
On Wed, Apr 18, 2018 at 6:53 PM, Michael Paquier wrote: >> I'm curious about what we'll find by just by adding >> Assert(!AnyBufferLockHeldByMe()) to the top of >> heap_tuple_fetch_attr(). AssertNotInCriticalSection() certainly found >> several bugs when it was first added. > > Yep. I wrote a sim

Re: VM map freeze corruption

2018-04-18 Thread Masahiko Sawada
On Wed, Apr 18, 2018 at 10:36 PM, Alvaro Herrera wrote: > Pavan Deolasee wrote: >> On Wed, Apr 18, 2018 at 7:37 AM, Wood, Dan wrote: > >> > My analysis is that heap_prepare_freeze_tuple->FreezeMultiXactId() >> > returns FRM_NOOP if the MultiXACT locked rows haven't committed. This >> > results i

Re: Speedup of relation deletes during recovery

2018-04-18 Thread Michael Paquier
On Thu, Apr 19, 2018 at 01:52:26AM +0900, Fujii Masao wrote: > No. But after my colleague truncated more than one hundred tables on > the server with shared_buffers = 300GB, the recovery could not finish > even after 10 minutes since the startup of the recovery. So I had to > shutdown the server im

Re: Adding an LWLockHeldByMe()-like function that reports if any buffer content lock is held

2018-04-18 Thread Michael Paquier
On Wed, Apr 18, 2018 at 06:44:00PM -0700, Peter Geoghegan wrote: > What I have in mind here is something that's a bit like > AssertNotInCriticalSection(). We don't need to pepper > AssertNotInCriticalSection() everywhere in practice, because calling > palloc() is a pretty good proxy for "function s

Re: ON CONFLICT DO UPDATE for partitioned tables

2018-04-18 Thread Amit Langote
On 2018/04/18 22:40, Alvaro Herrera wrote: > Amit Langote wrote: >> On 2018/04/18 0:04, Alvaro Herrera wrote: >>> Amit Langote wrote: >>> I just confirmed my hunch that this wouldn't somehow do the right thing when the OID system column is involved. Like this case: >>> >>> This looks too

Re: Problem while setting the fpw with SIGHUP

2018-04-18 Thread Michael Paquier
On Wed, Apr 18, 2018 at 10:52:51AM -0400, Robert Haas wrote: > I would just document the risks. If the documentation says that you > can't rely on the value until after the next checkpoint, or whatever > the rule is, then I think we're fine. I don't think that we really > have the infrastructure

Re: Adding an LWLockHeldByMe()-like function that reports if any buffer content lock is held

2018-04-18 Thread Peter Geoghegan
On Wed, Apr 18, 2018 at 5:46 PM, Michael Paquier wrote: > Personally, I favor approaches like that, because it allows to catch up > problems in using some APIs when people working on a patch miss any kind > of warning comments at the top of the function or within it which > summarize the condition

Re: reloption to prevent VACUUM from truncating empty pages at the end of relation

2018-04-18 Thread Michael Paquier
On Wed, Apr 18, 2018 at 07:41:44PM +0530, Amit Kapila wrote: > I think it makes sense to pursue that approach, but it might be worth > considering some alternative till we have it. I remember last time > (in 2015) we have discussed some another solution [1] to this problem > (or similar) and we ha

Re: Adding an LWLockHeldByMe()-like function that reports if any buffer content lock is held

2018-04-18 Thread Michael Paquier
On Wed, Apr 18, 2018 at 04:53:29PM -0700, Peter Geoghegan wrote: > It occurred to me that it would be nice to be able to > Assert(!AnyBufferLockHeldByMe()) at a certain point within > index_form_tuple(), to make sure that our assumptions hold. If > index_truncate_tuple() (or any other function) eve

Re: PostgreSQL's handling of fsync() errors is unsafe and risks data loss at least on XFS

2018-04-18 Thread Craig Ringer
On 19 April 2018 at 07:31, Mark Kirkwood wrote: > On 19/04/18 00:45, Craig Ringer wrote: > >> >> I guarantee you that when you create a 100GB EBS volume on AWS EC2, >> you don't get 100GB of storage preallocated. AWS are probably pretty >> good about not running out of backing store, though. >> >>

Re: Proposal: Adding json logging

2018-04-18 Thread Michael Paquier
On Wed, Apr 18, 2018 at 12:10:47PM -0700, Christophe Pettus wrote: > On Apr 18, 2018, at 11:59, Robert Haas wrote: >> For the record, I'm tentatively in favor of including something like >> this in contrib. > > I'm much less fussed by this in contrib/ (with the same concern you > noted), at minim

Re: Proposal: Adding json logging

2018-04-18 Thread Michael Paquier
On Wed, Apr 18, 2018 at 02:59:26PM -0400, Robert Haas wrote: > > Note that logging_collector should be enabled in postgresql.conf to > ensure consistent log outputs. As JSON strings are longer than normal > logs generated by PostgreSQL, this module increases the odds of malformed > log entrie

Re: Fix for documentation of Covering Indexes

2018-04-18 Thread Michael Paquier
On Wed, Apr 18, 2018 at 05:52:01AM -0400, Heikki Linnakangas wrote: > Committed, thanks! Thanks for the commit. -- Michael signature.asc Description: PGP signature

Re: [HACKERS] Runtime Partition Pruning

2018-04-18 Thread David Rowley
On 19 April 2018 at 12:04, David Rowley wrote: > insert into p select x,x from generate_Series(1,1000) x; > insert into t1 select x from generate_series(1,1000) x; Correction. These were meant to read: insert into p select x,x from generate_Series(1,1000) x; insert into t1 select x from gene

Re: [HACKERS] Runtime Partition Pruning

2018-04-18 Thread David Rowley
On 19 April 2018 at 03:13, Robert Haas wrote: > On Mon, Apr 16, 2018 at 10:46 PM, David Rowley > wrote: >> I did go and start working on a patch to test how possible this would >> be and came up with the attached. I've left a stray >> MemoryContextStatsDetail call in there which does indicate tha

Adding an LWLockHeldByMe()-like function that reports if any buffer content lock is held

2018-04-18 Thread Peter Geoghegan
During recent review of the INCLUDE covering index patch, I pushed to formalize the slightly delicate assumptions that we make around how index_truncate_tuple() is called. It's natural to call index_truncate_tuple() during a page split, when a buffer lock is held. This is what we actually do in mos

Re: PostgreSQL's handling of fsync() errors is unsafe and risks data loss at least on XFS

2018-04-18 Thread Mark Kirkwood
On 19/04/18 00:45, Craig Ringer wrote: I guarantee you that when you create a 100GB EBS volume on AWS EC2, you don't get 100GB of storage preallocated. AWS are probably pretty good about not running out of backing store, though. Some db folks (used to anyway) advise dd'ing to your freshly a

Re: pruning disabled for array, enum, record, range type partition keys

2018-04-18 Thread Tom Lane
Alvaro Herrera writes: > I now wonder if there's anything else that equivclass.c or indxpath.c > can teach us on this topic. I've been meaning to review this but have been a bit distracted. Will try to look tomorrow. regards, tom lane

Re: Query is over 2x slower with jit=on

2018-04-18 Thread Robert Haas
On Wed, Apr 18, 2018 at 3:29 PM, Andres Freund wrote: > Not convinced that that is true - the issue is more likely that JIT work in > workers is counted as execute time... Gotta add that somehow, not sure what > the best way would be. Oh, that does seem like something that should be fixed. If

Re: WIP: Covering + unique indexes.

2018-04-18 Thread Peter Geoghegan
On Wed, Apr 18, 2018 at 1:45 PM, Peter Geoghegan wrote: > I suggest committing this patch as-is. Actually, I see one tiny issue with extra '*' characters here: > +* The number of attributes won't be explicitly represented if the > +* negative infinity tuple was generated

Re: pruning disabled for array, enum, record, range type partition keys

2018-04-18 Thread Alvaro Herrera
Amit Langote wrote: > On Thu, Apr 19, 2018 at 12:01 AM, Alvaro Herrera > wrote: > > Makes sense. Still, I was expecting that pruning of hash partitioning > > would also work for pseudotypes, yet it doesn't. > > It does? Aha, so it does. While staring at this new code, I was confused as to why

Re: Should we add GUCs to allow partition pruning to be disabled?

2018-04-18 Thread David Rowley
On 18 April 2018 at 21:36, Ashutosh Bapat wrote: > On Wed, Apr 18, 2018 at 5:37 AM, David Rowley >> a) Disable run-time pruning during execution. >> b) Disable run-time pruning during planning. >> c) Both of the above. >> >> The differentiation of the above is important when you consider >> PREPAR

Re: Truncation failure in autovacuum results in data corruption (duplicate keys)

2018-04-18 Thread Tom Lane
I wrote: > Relation truncation throws away the page image in memory without ever > writing it to disk. Then, if the subsequent file truncate step fails, > we have a problem, because anyone who goes looking for that page will > fetch it afresh from disk and see the tuples as live. > There are WAL

Re: WIP: Covering + unique indexes.

2018-04-18 Thread Peter Geoghegan
On Wed, Apr 18, 2018 at 1:32 PM, Teodor Sigaev wrote: >> I don't understand. We do check the number of attributes on rightmost >> pages, but we do so separately, in the main loop. For every item that >> isn't the high key. > > Comment added, pls, verify. And refactored _bt_check_natts(), I hope, n

Re: WIP: Covering + unique indexes.

2018-04-18 Thread Teodor Sigaev
I don't understand. We do check the number of attributes on rightmost pages, but we do so separately, in the main loop. For every item that isn't the high key. Comment added, pls, verify. And refactored _bt_check_natts(), I hope, now it's a bit more readable. 4) BTreeTupSetNAtts - seems, it's

Re: Truncation failure in autovacuum results in data corruption (duplicate keys)

2018-04-18 Thread Tom Lane
"MauMau" writes: > I'd like to continue to think of a solution and create a patch, based > on the severity and how the customer will respond to our answer. I > have a feeling that we have to say it's a bit serious, since it > requires recovery from a base backup, not just rebuilding indexes. > Th

Re: Truncation failure in autovacuum results in data corruption (duplicate keys)

2018-04-18 Thread MauMau
From: Tom Lane [ re-reads thread... ] The extra assumption you need in order to have trouble is that the blocks in question are dirty in shared buffers and have never been written to disk since their rows were deleted. Then the situation is that the page image on disk shows the rows as live, whil

Re: Proposal: Adding json logging

2018-04-18 Thread Alvaro Herrera
John W Higgins wrote: > On Sun, Apr 15, 2018 at 11:08 AM, David Arnold wrote: > > > >This would appear to solve multiline issues within Fluent. > > >https://docs.fluentd.org/v0.12/articles/parser_multiline > > > > I definitely looked at that, but what guarantees do I have that the > > sequenc

Re: reloption to prevent VACUUM from truncating empty pages at the end of relation

2018-04-18 Thread Tom Lane
I wrote: > Pavan Deolasee writes: >> What if we remember the buffers as seen by count_nondeletable_pages() and >> then just discard those specific buffers instead of scanning the entire >> shared_buffers again? > That's an idea. BTW, before pushing too hard on any of this, we need to think about

Re: Proposal: Adding json logging

2018-04-18 Thread David Arnold
Excellent phrasing (thanks to Christophe!): "There is a large class of log analysis tool out there that has trouble with multiline formats and we should be good ecosystem players" > I'm much less fussed by this in contrib/ (with the same concern you noted), at a minimum as an example of how to do

Re: Query is over 2x slower with jit=on

2018-04-18 Thread Andres Freund
On April 18, 2018 12:16:35 PM PDT, Robert Haas wrote: >On Wed, Apr 18, 2018 at 11:50 AM, Andres Freund >wrote: >> JIT has cost, and sometimes it's not beneficial. Here our heuristics >> when to JIT appear to be a bit off. In the parallel world it's worse >> because the JITing is duplicated for

Re: Query is over 2x slower with jit=on

2018-04-18 Thread Robert Haas
On Wed, Apr 18, 2018 at 11:50 AM, Andres Freund wrote: > JIT has cost, and sometimes it's not beneficial. Here our heuristics > when to JIT appear to be a bit off. In the parallel world it's worse > because the JITing is duplicated for parallel workers atm. It seems like you're describing it as i

Re: Proposal: Adding json logging

2018-04-18 Thread Christophe Pettus
> On Apr 18, 2018, at 11:59, Robert Haas wrote: > > I'm not sure exactly how you intended to this comment, but it seems to > me that whether CSV is ease or hard to parse, somebody might > legitimately find JSON more convenient. Of course. The specific comment I was replying to made a couple of

Re: Truncation failure in autovacuum results in data corruption (duplicate keys)

2018-04-18 Thread Tom Lane
"MauMau" writes: > However, I have a question. How does the truncation failure in > autovacuum lead to duplicate keys? The failed-to-be-truncated pages > should only contain dead tuples, so pg_dump's table scan should ignore > dead tuples in those pages. [ re-reads thread... ] The extra assump

Re: Proposal: Adding json logging

2018-04-18 Thread Robert Haas
On Sun, Apr 15, 2018 at 1:07 PM, Christophe Pettus wrote: >> On Apr 15, 2018, at 09:51, David Arnold wrote: >> 1. Throughout this vivid discussion a good portion of support has already >> been manifested for the need of a more structured (machine readable) logging >> format. There has been no s

Re: Deadlock in multiple CIC.

2018-04-18 Thread Tom Lane
Alvaro Herrera writes: > Tom Lane wrote: >> Will look into that too. I'm not sure that adding extra expected >> outputs is sane, though --- might be best to just force the intended >> isolation level within those tests. > As I recall (not much, admittedly) that was one of the options we > consid

Re: reloption to prevent VACUUM from truncating empty pages at the end of relation

2018-04-18 Thread Tom Lane
Pavan Deolasee writes: > What if we remember the buffers as seen by count_nondeletable_pages() and > then just discard those specific buffers instead of scanning the entire > shared_buffers again? That's an idea. > Surely we revisit all to-be-truncated blocks before > actual truncation. So we al

Truncation failure in autovacuum results in data corruption (duplicate keys)

2018-04-18 Thread MauMau
Hello, It seems to me that our customer might have hit an unresolved data corruption issue which is already known in this ML, but I can't figure out why this happened. I'd appreciate if you could give me your thoughts. Depending on the severity of this issue and the customer's request, I think I

Re: reloption to prevent VACUUM from truncating empty pages at the end of relation

2018-04-18 Thread Pavan Deolasee
On Wed, Apr 18, 2018 at 10:50 PM, Fujii Masao wrote: > > > I'm not sure if it's safe to cancel forcibly VACUUM's truncation during > scaning shared_buffers. That scan happens after WAL-logging and before > the actual truncation. > > Ah ok. I misread your proposal. This is about the shared_buffers

Re: WIP: Covering + unique indexes.

2018-04-18 Thread Peter Geoghegan
(() On Wed, Apr 18, 2018 at 10:10 AM, Teodor Sigaev wrote: > I mostly agree with your patch, nice work, but I have some notices for your > patch: Thanks. > 1) > bt_target_page_check(): > if (!P_RIGHTMOST(topaque) && > !_bt_check_natts(state->rel, state->target, P_HIKEY)) > > Seems no

Re: pgindent run soon?

2018-04-18 Thread Tom Lane
Teodor Sigaev writes: >> If there are large refactoring or bug-fix patches that haven't landed >> yet, then it'd be appropriate to wait for those to get in, but I'm not >> aware of such at the moment. > Pls, wait > https://www.postgresql.org/message-id/9c63951d-7696-ecbb-b832-70db7ed3f39b%40sigae

Re: reloption to prevent VACUUM from truncating empty pages at the end of relation

2018-04-18 Thread Fujii Masao
On Wed, Apr 18, 2018 at 11:29 PM, Pavan Deolasee wrote: > > > On Tue, Apr 17, 2018 at 11:05 PM, Fujii Masao wrote: >> >> Hi, >> >> I'd like to propose to add $SUBJECT for performance improvement. >> >> When VACUUM tries to truncate the trailing empty pages, it scans >> shared_buffers >> to invali

Re: pgindent run soon?

2018-04-18 Thread Teodor Sigaev
If there are large refactoring or bug-fix patches that haven't landed yet, then it'd be appropriate to wait for those to get in, but I'm not aware of such at the moment. Pls, wait https://www.postgresql.org/message-id/9c63951d-7696-ecbb-b832-70db7ed3f39b%40sigaev.ru Thank you. -- Teodor Sigaev

Re: WIP: Covering + unique indexes.

2018-04-18 Thread Teodor Sigaev
I mostly agree with your patch, nice work, but I have some notices for your patch: 1) bt_target_page_check(): if (!P_RIGHTMOST(topaque) && !_bt_check_natts(state->rel, state->target, P_HIKEY)) Seems not very obvious: it looks like we don't need to check nattrs on rightmost page. Ok

Re: Query is over 2x slower with jit=on

2018-04-18 Thread Andres Freund
On April 18, 2018 9:50:48 AM PDT, Chapman Flack wrote: >On 04/18/2018 12:27 PM, Simon Riggs wrote: > >> Please change the name of the "JIT" parameter to something meaningful >> to humans before this gets too far into the wild. >> >> SSL is somewhat understandable because its not a Postgres-priv

Re: Speedup of relation deletes during recovery

2018-04-18 Thread Fujii Masao
On Wed, Apr 18, 2018 at 10:44 AM, Michael Paquier wrote: > On Wed, Apr 18, 2018 at 12:46:58AM +0900, Fujii Masao wrote: >> Yes, I think. And, I found that smgrdounlinkfork() is also dead code. >> Per the discussion [1], this unused function was left intentionally. >> But it's still dead code since

Re: Query is over 2x slower with jit=on

2018-04-18 Thread Chapman Flack
On 04/18/2018 12:27 PM, Simon Riggs wrote: > Please change the name of the "JIT" parameter to something meaningful > to humans before this gets too far into the wild. > > SSL is somewhat understandable because its not a Postgres-private term. JIT is hardly a Postgres-private term. It's a familia

Re: Deadlock in multiple CIC.

2018-04-18 Thread Alvaro Herrera
Tom Lane wrote: > *** /home/postgres/pgsql/src/test/isolation/expected/lock-update-delete_1.out > Mon Feb 12 14:53:46 2018 > --- > /home/postgres/pgsql/src/test/isolation/output_iso/results/lock-update-delete.out >Wed Apr 18 11:30:23 2018 > *** > *** 150,156 > > t

Re: Query is over 2x slower with jit=on

2018-04-18 Thread Simon Riggs
On 18 April 2018 at 16:50, Andres Freund wrote: > On 2018-04-18 17:35:31 +0200, Andreas Joseph Krogh wrote: >> With jit=on: >> https://explain.depesz.com/s/vYB >> Planning Time: 0.336 ms >> JIT: >> Functions: 716 >> Generation Time: 78.404 ms >> Inlining: false >> Inlining Time: 0.000 ms

Sv: Re: Query is over 2x slower with jit=on

2018-04-18 Thread Andreas Joseph Krogh
På onsdag 18. april 2018 kl. 17:50:55, skrev Andres Freund mailto:and...@anarazel.de>>: On 2018-04-18 17:35:31 +0200, Andreas Joseph Krogh wrote: > With jit=on: > https://explain.depesz.com/s/vYB > Planning Time: 0.336 ms >  JIT: >   Functions: 716 >   Generation Time: 78.404 ms >   Inlining

Re: Setting rpath on llvmjit.so?

2018-04-18 Thread Yuriy Zhuravlev
I talked about autoconf build system, /tools/msvc it's extra home build system. On Thu, 19 Apr 2018, 00:58 Andres Freund, wrote: > On 2018-04-18 15:54:59 +, Yuriy Zhuravlev wrote: > > Current autoconf system not working on Windows at all, what we talk > about? > > We generate windows project

Re: Setting rpath on llvmjit.so?

2018-04-18 Thread Yuriy Zhuravlev
> > I also politely decline the offer to be forced to use XCode on mac. Why? We supporting MSVC and not nmake, what difference with xcode? Also, it's just extra benefit from cmake/meson.

Re: Setting rpath on llvmjit.so?

2018-04-18 Thread Andres Freund
On 2018-04-18 15:54:59 +, Yuriy Zhuravlev wrote: > Current autoconf system not working on Windows at all, what we talk about? We generate windows project files. See src/tools/msvc/ - Andres

Re: Setting rpath on llvmjit.so?

2018-04-18 Thread Yuriy Zhuravlev
Current autoconf system not working on Windows at all, what we talk about? On Wed, 18 Apr 2018, 23:57 Robert Haas, wrote: > On Tue, Apr 17, 2018 at 4:13 PM, Andres Freund wrote: > > I'd not advocate for this solely based on the age of autoconf. But the > > separate windows buildsystem which mak

Re: Query is over 2x slower with jit=on

2018-04-18 Thread Andres Freund
On 2018-04-18 17:35:31 +0200, Andreas Joseph Krogh wrote: > With jit=on: > https://explain.depesz.com/s/vYB > Planning Time: 0.336 ms > JIT: >  Functions: 716 >  Generation Time: 78.404 ms >  Inlining: false >  Inlining Time: 0.000 ms >  Optimization: false >  Optimization Time: 43.916 ms >

Re: [FEATURE PATCH] pg_stat_statements with plans (v02)

2018-04-18 Thread Julian Markwort
On Fri, 2018-04-06 at 13:57 -0700, legrand legrand wrote: > At startup time there are 2 identical plans found in the view > I thought it should have be only one: the "initial" one > (as long as there is no "good" or "bad" one). Yes, those are 'remnants' from the time where I had two columns, one

Re: reloption to prevent VACUUM from truncating empty pages at the end of relation

2018-04-18 Thread Simon Riggs
On 17 April 2018 at 20:09, Tom Lane wrote: > Alvaro Herrera writes: >> Andres was working on a radix tree structure to fix this problem, but >> that seems to be abandoned now, and it seems a major undertaking. While >> I agree that the proposed solution is a wart, it seems much better than >> no

Re: Deadlock in multiple CIC.

2018-04-18 Thread Tom Lane
I wrote: >>> (A couple of the other isolation tests do fail reliably under this >>> scenario; is it worth hardening them?) >> Yes, I think it's worth making them pass somehow -- see commits >> f18795e7b74c, a0eae1a2eeb6. > Will look into that too. I'm not sure that adding extra expected > output

Re: Deadlock in multiple CIC.

2018-04-18 Thread Alvaro Herrera
Tom Lane wrote: > Anyway, at this point I'm going to give up on the debug logging, revert > 9.4 to its prior state, and then see if the transaction-restart patch > makes the problem go away. Agreed, thanks. > >> (A couple of the other isolation tests do fail reliably under this > >> scenario; is

Query is over 2x slower with jit=on

2018-04-18 Thread Andreas Joseph Krogh
Hi all.   I don't know whether this is expected or not but I'm experiencing over 2x slowdown on a large query in PG-11 with JIT=on.   (query is a prepared statement executed with "explain analyze execute myprepared(arg1, arg2, ..., argn)")   After 10 executions these are the results (the first 5

Re: Deadlock in multiple CIC.

2018-04-18 Thread Tom Lane
I wrote: >> It's still not entirely clear what's happening on okapi, ... okapi has now passed two consecutive runs with elog(LOG) messages in place between DefineIndex's snapmgr calls. Considering that it had failed 37 of 44 test runs since 47a3a13 went in, I think two successive passes is suffic

Re: pgindent run soon?

2018-04-18 Thread Robert Haas
On Tue, Apr 17, 2018 at 12:57 PM, Tom Lane wrote: > Now that feature freeze is past, I wonder if it's time to run pgindent. +1 -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company

Re: [HACKERS] Runtime Partition Pruning

2018-04-18 Thread Robert Haas
On Mon, Apr 16, 2018 at 10:46 PM, David Rowley wrote: > I did go and start working on a patch to test how possible this would > be and came up with the attached. I've left a stray > MemoryContextStatsDetail call in there which does indicate that > something is not being freed. I'm just not sure wh

Re: pruning disabled for array, enum, record, range type partition keys

2018-04-18 Thread Amit Langote
On Thu, Apr 19, 2018 at 12:01 AM, Alvaro Herrera wrote: > Amit Langote wrote: > >> On 2018/04/18 7:11, Alvaro Herrera wrote: >> >> @@ -1546,8 +1546,8 @@ match_clause_to_partition_key(RelOptInfo *rel, >>case PARTITION_STRATEGY_HASH: >> cmpfn = get_opfamily_proc(part_scheme->partopfamily[p

Re: pruning disabled for array, enum, record, range type partition keys

2018-04-18 Thread Alvaro Herrera
Amit Langote wrote: > On 2018/04/18 7:11, Alvaro Herrera wrote: > > @@ -1546,8 +1546,8 @@ match_clause_to_partition_key(RelOptInfo *rel, >case PARTITION_STRATEGY_HASH: > cmpfn = get_opfamily_proc(part_scheme->partopfamily[partkeyidx], > - op_righttype, op_r

Re: Setting rpath on llvmjit.so?

2018-04-18 Thread Tom Lane
Peter Eisentraut writes: > On 4/17/18 16:14, Andres Freund wrote: >> I still think cmake is the least unreasonable path going forward. > I would rather try to make Meson work and if needed add features back > into Meson. I'm wondering whether that will result in expending a lot of effort to move

Re: Setting rpath on llvmjit.so?

2018-04-18 Thread Robert Haas
On Tue, Apr 17, 2018 at 4:13 PM, Andres Freund wrote: > I'd not advocate for this solely based on the age of autoconf. But the > separate windows buildsystem which makes it very hard to build > extensions separately is a good reason on its own. As is the fact that > recursive make as we're using i

Re: Problem while setting the fpw with SIGHUP

2018-04-18 Thread Robert Haas
On Wed, Apr 18, 2018 at 10:37 AM, Amit Kapila wrote: > On Fri, Apr 13, 2018 at 10:36 PM, Robert Haas wrote: >> On Thu, Apr 12, 2018 at 9:29 PM, Michael Paquier wrote: >>> Still does it matter when the change is effective? >> >> I don't really care deeply about when the change takes effect, but I

Re: Problem while setting the fpw with SIGHUP

2018-04-18 Thread Amit Kapila
On Fri, Apr 13, 2018 at 10:36 PM, Robert Haas wrote: > On Thu, Apr 12, 2018 at 9:29 PM, Michael Paquier wrote: >> Still does it matter when the change is effective? > > I don't really care deeply about when the change takes effect, but I > do care about whether the time when the system *says* the

Re: Setting rpath on llvmjit.so?

2018-04-18 Thread Peter Eisentraut
On 4/17/18 16:14, Andres Freund wrote: > I still think cmake is the least unreasonable path going forward. I would rather try to make Meson work and if needed add features back into Meson. -- Peter Eisentraut http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote D

Re: Documentation for bootstrap data conversion

2018-04-18 Thread Tom Lane
John Naylor writes: > On 4/9/18, Tom Lane wrote: >> Meh, I think either is fine really. I do recall changing something >> in bki.sgml that referred to both "bootstrap relations" and "bootstrap >> catalogs" in practically the same sentence. I think that *is* confusing, >> because it's not obviou

Re: remove quoting hacks and simplify bootscanner.l

2018-04-18 Thread Tom Lane
John Naylor writes: > For the bootstrap data conversion, it was desirable for postgres.bki > to remain unchanged, so some ugly quoting hacks were added to > genbki.pl to match the quoting conventions in the DATA() lines. At > this point, it's possible (and worthwhile I think) to remove those, > an

Re: reloption to prevent VACUUM from truncating empty pages at the end of relation

2018-04-18 Thread Pavan Deolasee
On Tue, Apr 17, 2018 at 11:05 PM, Fujii Masao wrote: > Hi, > > I'd like to propose to add $SUBJECT for performance improvement. > > When VACUUM tries to truncate the trailing empty pages, it scans > shared_buffers > to invalidate the pages-to-truncate during holding an AccessExclusive lock > on >

Re: Built-in connection pooling

2018-04-18 Thread Vladimir Borodin
> 18 апр. 2018 г., в 16:24, David Fetter написал(а): > > On Wed, Apr 18, 2018 at 02:52:39PM +0300, Konstantin Knizhnik wrote: >> Yandex team is following this approach with theirOdysseus >> (multithreaded version of pgbouncer with many of pgbouncer issues >> fixed). > > Have they opened the so

Re: reloption to prevent VACUUM from truncating empty pages at the end of relation

2018-04-18 Thread Amit Kapila
On Wed, Apr 18, 2018 at 7:46 AM, Andres Freund wrote: > On 2018-04-18 10:46:51 +0900, Michael Paquier wrote: >> On Tue, Apr 17, 2018 at 06:13:31PM -0700, Andres Freund wrote: >> > Not sure what you mean? >> >> Do you need help on it? I suggest that I could undertake the proposed >> patch and subm

Re: Postgres stucks in deadlock detection

2018-04-18 Thread Konstantin Knizhnik
On 16.04.2018 14:11, Konstantin Knizhnik wrote: On 14.04.2018 10:09, Юрий Соколов wrote: пт, 13 апр. 2018 г., 21:10 Andres Freund >: Hi, On 2018-04-13 19:13:07 +0300, Konstantin Knizhnik wrote: > On 13.04.2018 18:41, Andres Freund wrote: > > On 20

Re: Built-in connection pooling

2018-04-18 Thread Konstantin Knizhnik
On 18.04.2018 16:41, Heikki Linnakangas wrote: On 18/04/18 07:52, Konstantin Knizhnik wrote: On 18.04.2018 13:36, Heikki Linnakangas wrote: On 18/04/18 06:10, Konstantin Knizhnik wrote: But there are still use cases which can not be covered y external connection pooler. Can you name some

Re: Built-in connection pooling

2018-04-18 Thread Heikki Linnakangas
On 18/04/18 07:52, Konstantin Knizhnik wrote: On 18.04.2018 13:36, Heikki Linnakangas wrote: On 18/04/18 06:10, Konstantin Knizhnik wrote: But there are still use cases which can not be covered y external connection pooler. Can you name some? I understand that the existing external connecti

Re: ON CONFLICT DO UPDATE for partitioned tables

2018-04-18 Thread Alvaro Herrera
Amit Langote wrote: > On 2018/04/18 0:04, Alvaro Herrera wrote: > > Amit Langote wrote: > > > >> I just confirmed my hunch that this wouldn't somehow do the right thing > >> when the OID system column is involved. Like this case: > > > > This looks too big a patch to pursue now. I'm inclined to

Re: VM map freeze corruption

2018-04-18 Thread Alvaro Herrera
Pavan Deolasee wrote: > On Wed, Apr 18, 2018 at 7:37 AM, Wood, Dan wrote: > > My analysis is that heap_prepare_freeze_tuple->FreezeMultiXactId() > > returns FRM_NOOP if the MultiXACT locked rows haven't committed. This > > results in changed=false and totally_frozen=true(as initialized). When >

  1   2   >