Re: Postgresql 10.3 , query never completes if LIMIT clause is specified and paralle processing is on

2018-03-28 Thread Tomas Vondra
Hi, the perf profiles look really weird - clearly, there's a lot of lock contention, because the top item is this 13.49%13.40% postmaster postgres [.] LWLockAcquire | ---LWLockAcquire That's a sign of lock contention - not sure which one,

Re: Postgresql 10.3 , query never completes if LIMIT clause is specified and paralle processing is on

2018-03-28 Thread Alessandro Aste
Hello, any news ? Thank you, Alessandro. On Fri, Mar 23, 2018 at 8:22 PM, Alessandro Aste wrote: > PS , in the meanwhile I discovered a 2nd workaround(beside disabling > parallel processing) . I added offset 0 to the subquery , and, according > to the

Re: Postgresql 10.3 , query never completes if LIMIT clause is specified and paralle processing is on

2018-03-23 Thread Alessandro Aste
PS , in the meanwhile I discovered a 2nd workaround(beside disabling parallel processing) . I added offset 0 to the subquery , and, according to the documentation, “OFFSET 0 is the same as omitting the OFFSET clause” - https://www.postgresql.org/docs/current/static/queries-limit.html cmd3dev=#

Re: Postgresql 10.3 , query never completes if LIMIT clause is specified and paralle processing is on

2018-03-22 Thread Alessandro Aste
Thanks Tomas. We're currently building postgres from source. In order to enable symbols, you want me to re-configure postres with --enable-debug then run perf? Regards, On Thu, Mar 22, 2018 at 5:00 PM, Tomas Vondra wrote: > > > On 03/22/2018 11:33 AM, Alessandro

Re: Postgresql 10.3 , query never completes if LIMIT clause is specified and paralle processing is on

2018-03-22 Thread Tomas Vondra
On 03/22/2018 11:29 PM, Alessandro Aste wrote: > Thanks Tomas. We're currently building postgres from source. In order to > enable symbols, you want me to re-configure postres with  --enable-debug > then run perf? > Yes. regards -- Tomas Vondra http://www.2ndQuadrant.com

Re: Postgresql 10.3 , query never completes if LIMIT clause is specified and paralle processing is on

2018-03-22 Thread Tomas Vondra
On 03/22/2018 11:33 AM, Alessandro Aste wrote: > Tomas, thank you. This machine  is abare metal server running only a > staging postgresql 10.3  instance. Nobody is using it beside me.  > > I'm attaching 4 files.   > > every_30_seconds_top_stats_during_query.txt    - this is a caputure of >

Re: Postgresql 10.3 , query never completes if LIMIT clause is specified and paralle processing is on

2018-03-22 Thread Alessandro Aste
Tomas, thank you. This machine is abare metal server running only a staging postgresql 10.3 instance. Nobody is using it beside me. I'm attaching 4 files. every_30_seconds_top_stats_during_query.txt- this is a caputure of the top command every 30 seconds(more or less) for 10+ minutes while

Re: Postgresql 10.3 , query never completes if LIMIT clause is specified and paralle processing is on

2018-03-21 Thread Tomas Vondra
On 03/21/2018 08:44 PM, Alessandro Aste wrote: > Thanks for your reply Tomas.  The query just got stuck for forever.  I > observed no CPU spikes, it is currently running and I see 89 of the CPU > idle. I'm using a relative powerfull machine (120 GB ram, 56 CPU).   > That doesn't really answer

Re: Postgresql 10.3 , query never completes if LIMIT clause is specified and paralle processing is on

2018-03-21 Thread Alessandro Aste
Thanks for your reply Tomas. The query just got stuck for forever. I observed no CPU spikes, it is currently running and I see 89 of the CPU idle. I'm using a relative powerfull machine (120 GB ram, 56 CPU). Plain analyze as requested. : QUERY PLAN

Re: Postgresql 10.3 , query never completes if LIMIT clause is specified and paralle processing is on

2018-03-21 Thread Tomas Vondra
On 03/21/2018 05:09 PM, Alessandro Aste wrote: > Hi there, we are using postgresql 10.3 and we're facing an issue with a > query. The query (full query below)  completes only  when:  > > 1 - LIMIT 10 is removed > or > 2 -  show max_parallel_workers_per_gather  is set to 0, so parallel >

Postgresql 10.3 , query never completes if LIMIT clause is specified and paralle processing is on

2018-03-21 Thread Alessandro Aste
Hi there, we are using postgresql 10.3 and we're facing an issue with a query. The query (full query below) completes only when: 1 - LIMIT 10 is removed or 2 - show max_parallel_workers_per_gather is set to 0, so parallel processing is disabled. With max_parallel_workers_per_gather set to