Re: Parallel Seq Scan

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
Cc: Kouhei Kaigai <kaigai(at)ak(dot)jp(dot)nec(dot)com>, Haribabu Kommi <kommi(dot)haribabu(at)gmail(dot)com>, Gavin Flower <GavinFlower(at)archidevsys(dot)co(dot)nz>, Jeff Davis <pgsql(at)j-davis(dot)com>, Andres Freund <andres(at)2ndquadrant(dot)com>, Amit Langote <amitlangote09(at)gmail(dot)com>, Amit Langote <Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp>, Fabrízio Mello <fabriziomello(at)gmail(dot)com>, Thom Brown <thom(at)linux(dot)com>, Stephen Frost <sfrost(at)snowman(dot)net>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Parallel Seq Scan
Date: 2015-09-26 00:37:38
Message-ID: CA+TgmoZHoiFki0prU0ECMFkyiw7WAAZfi-TK1dMCBDjg_WuiZg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Sep 25, 2015 at 7:46 AM, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> wrote:
> I have a question here which is why this format doesn't have a similar
> problem
> as the current version, basically in current patch the second read of
> SerializedParamExternData can be misaligned and for same reason in your
> patch the second read of Oid could by misaligned?

memcpy() can cope with unaligned data; structure member assignment can't.

I've worked some of this code over fairly heavily today and I'm pretty
happy with how my copy of execParallel.c looks now, but I've run into
one issue where I wanted to check with you. There are three places
where Instrumentation can be attached to a query: a ResultRelInfo's
ri_TrigInstrument (which doesn't matter for us because we don't
support parallel write queries, and triggers don't run on reads), a
PlanState's instrument, and a QueryDesc's total time.

Your patch makes provision to copy ONE Instrumentation structure per
worker back to the parallel leader. I assumed this must be the
QueryDesc's totaltime, but it looks like it's actually the PlanState
of the top node passed to the worker. That's of course no good if we
ever push more than one node down to the worker, which we may very
well want to do in the initial version, and surely want to do
eventually. We can't just deal with the top node and forget all the
others. Is that really what's happening here, or am I confused?

Assuming I'm not confused, I'm planning to see about fixing this...

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Josh Berkus 2015-09-26 01:18:25 Re: No Issue Tracker - Say it Ain't So!
Previous Message Robert Haas 2015-09-26 00:24:10 Re: Parallel Seq Scan