Re: Parallel Seq Scan

From: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
To: Haribabu Kommi <kommi(dot)haribabu(at)gmail(dot)com>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Parallel Seq Scan
Date: 2015-10-12 11:45:03
Message-ID: CAA4eK1KCymW+-vJuAgSxf-s4K-0X3dBxDcw5Hem+qSgergxY4A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Oct 12, 2015 at 11:51 AM, Haribabu Kommi <kommi(dot)haribabu(at)gmail(dot)com>
wrote:
>
> On Mon, Oct 5, 2015 at 11:20 PM, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
wrote:
> > For now, I have fixed this by not preserving the startblock incase of
rescan
> > for parallel scan. Note that, I have created a separate patch
> > (parallel_seqscan_heaprescan_v1.patch) for support of rescan (for
parallel
> > scan).
>
> while testing parallel seqscan, My colleague Jing Wang has found a
problem in
> parallel_seqscan_heapscan_v2.patch.
>

Thanks for spotting the issue.

> In function initscan, the allow_sync flag is set to false as the
> number of pages in the
> table are less than NBuffers/4.
>
> if (!RelationUsesLocalBuffers(scan->rs_rd) &&
> scan->rs_nblocks > NBuffers / 4)
>
> As allow_sync flag is false, the function
> heap_parallelscan_initialize_startblock is not
> called in initscan function to initialize the
> parallel_scan->phs_cblock parameter. Because
> of this reason while getting the next page in
> heap_parallelscan_nextpage, it returns
> InvalidBlockNumber, thus it ends the scan without returning the results.
>

Right, it should initialize parallel scan properly even for non-synchronized
scans. Fixed the issue in attached patch. Rebased heap rescan is
attached as well.

With Regards,
Amit Kapila.
EnterpriseDB: http://www.enterprisedb.com

Attachment Content-Type Size
parallel_seqscan_heapscan_v3.patch application/octet-stream 16.5 KB
parallel_seqscan_heaprescan_v2.patch application/octet-stream 3.5 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2015-10-12 11:51:35 Re: [PATCH v1] GSSAPI encryption support
Previous Message Amit Kapila 2015-10-12 11:16:25 Re: Postgres service stops when I kill client backend on Windows