Re: [HACKERS] Parallel bitmap heap scan - Mailing list pgsql-hackers

From Rafia Sabih
Subject Re: [HACKERS] Parallel bitmap heap scan
Date
Msg-id CAOGQiiN3pOMLuNxQuUTxSrmKA=psL3rKi2tBPGkgFUOo7BfBrw@mail.gmail.com
Whole thread Raw
In response to Re: [HACKERS] Parallel bitmap heap scan  (tushar <tushar.ahuja@enterprisedb.com>)
Responses Re: [HACKERS] Parallel bitmap heap scan  (Dilip Kumar <dilipbalaut@gmail.com>)
List pgsql-hackers
On Wed, Jan 11, 2017 at 5:33 PM, tushar <tushar.ahuja@enterprisedb.com> wrote:
>
> On 01/10/2017 05:16 PM, Dilip Kumar wrote:
>>
>>   Please try attached patch and confirm from your
>> side.
>
> Thanks,issue seems to be fixed now.
>
>
> --
> regards,tushar
> EnterpriseDB  https://www.enterprisedb.com/
> The Enterprise PostgreSQL Company
>
>
>
> --
> Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-hackers


Hello Dilip,
I was trying to test the performance of all the parallel query related
patches on TPC-H queries, I found that when parallel hash [1 ]and your
patch are applied then Q10 and Q14 were hanged, however, without any
one of these patches, these queries are running fine. Following is the
stack trace,

At the master:

#0  0x00003fff8bef7de8 in __epoll_wait_nocancel () from /lib64/power8/libc.so.6
#1  0x00000000104ea184 in WaitEventSetWaitBlock (set=0x10039b2d360,
cur_timeout=-1, occurred_events=0x3fffd4a55a98, nevents=1) at
latch.c:998
#2  0x00000000104e9fc8 in WaitEventSetWait (set=0x10039b2d360,
timeout=-1, occurred_events=0x3fffd4a55a98, nevents=1,
wait_event_info=134217730) at latch.c:950
#3  0x00000000104e9484 in WaitLatchOrSocket (latch=0x3fff85128ab4,
wakeEvents=1, sock=-1, timeout=-1, wait_event_info=134217730) at
latch.c:350
#4  0x00000000104e931c in WaitLatch (latch=0x3fff85128ab4,
wakeEvents=1, timeout=0, wait_event_info=134217730) at latch.c:304
#5  0x000000001032a378 in gather_readnext (gatherstate=0x10039aeeb98)
at nodeGather.c:393
#6  0x000000001032a044 in gather_getnext (gatherstate=0x10039aeeb98)
at nodeGather.c:293
#7  0x0000000010329e94 in ExecGather (node=0x10039aeeb98) at nodeGather.c:234
#8  0x00000000103086f0 in ExecProcNode (node=0x10039aeeb98) at
execProcnode.c:521
#9  0x000000001031f550 in fetch_input_tuple (aggstate=0x10039aed220)
at nodeAgg.c:587
#10 0x00000000103229a4 in agg_retrieve_direct (aggstate=0x10039aed220)
at nodeAgg.c:2211

At one of the worker process,

#0  0x00000000103879f8 in pagetable_insert (tb=0x10039abcac0,
key=6491, found=0x3fffd4a54b88 "") at
../../../src/include/lib/simplehash.h:571
#1  0x0000000010389964 in tbm_get_pageentry (tbm=0x10039ab5778,
pageno=6491) at tidbitmap.c:876
#2  0x0000000010388608 in tbm_add_tuples (tbm=0x10039ab5778,
tids=0x10039a94c30, ntids=1, recheck=0 '\000') at tidbitmap.c:340
#3  0x00000000100f5e54 in btgetbitmap (scan=0x10039ab3c80,
tbm=0x10039ab5778) at nbtree.c:439
#4  0x00000000100eab7c in index_getbitmap (scan=0x10039ab3c80,
bitmap=0x10039ab5778) at indexam.c:687
#5  0x0000000010328acc in MultiExecBitmapIndexScan
(node=0x10039a98630) at nodeBitmapIndexscan.c:98
#6  0x00000000103088d8 in MultiExecProcNode (node=0x10039a98630) at
execProcnode.c:591
#7  0x0000000010326c70 in BitmapHeapNext (node=0x10039a98770) at
nodeBitmapHeapscan.c:164
#8  0x0000000010316440 in ExecScanFetch (node=0x10039a98770,
accessMtd=0x10326b70 <BitmapHeapNext>, recheckMtd=0x10327bb4
<BitmapHeapRecheck>) at execScan.c:95
#9  0x0000000010316590 in ExecScan (node=0x10039a98770,
accessMtd=0x10326b70 <BitmapHeapNext>, recheckMtd=0x10327bb4
<BitmapHeapRecheck>) at execScan.c:180
#10 0x0000000010327c84 in ExecBitmapHeapScan (node=0x10039a98770) at
nodeBitmapHeapscan.c:623

At other workers,

#0  0x00003fff8bef7de8 in __epoll_wait_nocancel () from /lib64/power8/libc.so.6
#1  0x00000000104ea184 in WaitEventSetWaitBlock (set=0x10039a24670,
cur_timeout=-1, occurred_events=0x3fffd4a55ed8, nevents=1) at
latch.c:998
#2  0x00000000104e9fc8 in WaitEventSetWait (set=0x10039a24670,
timeout=-1, occurred_events=0x3fffd4a55ed8, nevents=1,
wait_event_info=134217737) at latch.c:950
#3  0x000000001051a3dc in ConditionVariableSleep (cv=0x3fff7c2d01ac,
wait_event_info=134217737) at condition_variable.c:132
#4  0x00000000103283e0 in pbms_is_leader (pbminfo=0x3fff7c2d0178) at
nodeBitmapHeapscan.c:900
#5  0x0000000010326c38 in BitmapHeapNext (node=0x10039a95f50) at
nodeBitmapHeapscan.c:153
#6  0x0000000010316440 in ExecScanFetch (node=0x10039a95f50,
accessMtd=0x10326b70 <BitmapHeapNext>, recheckMtd=0x10327bb4
<BitmapHeapRecheck>) at execScan.c:95
#7  0x0000000010316590 in ExecScan (node=0x10039a95f50,
accessMtd=0x10326b70 <BitmapHeapNext>, recheckMtd=0x10327bb4
<BitmapHeapRecheck>) at execScan.c:180
#8  0x0000000010327c84 in ExecBitmapHeapScan (node=0x10039a95f50) at
nodeBitmapHeapscan.c:623
#9  0x0000000010308588 in ExecProcNode (node=0x10039a95f50) at
execProcnode.c:443
#10 0x00000000103310d8 in ExecHashJoinOuterGetTuple
(outerNode=0x10039a95f50, hjstate=0x10039a96808,
hashvalue=0x3fffd4a5639c) at nodeHashjoin.c:936

I was using TPC-H with scale factor 20, please let me know if there is
anything more you require in this regard.

[1] https://www.postgresql.org/message-id/CAEepm%3D1vGcv6LBrxZeqPb_rPxfraidWAF_8_4z2ZMQ%2B7DOjj9w%40mail.gmail.com
-- 
Regards,
Rafia Sabih
EnterpriseDB: http://www.enterprisedb.com/



pgsql-hackers by date:

Previous
From: Masahiko Sawada
Date:
Subject: Re: [HACKERS] Retiring from the Core Team
Next
From: Rahila Syed
Date:
Subject: Re: [HACKERS] Parallel Index-only scan