From: Andres Freund <andres@anarazel.de>
To: Peter Geoghegan <pg@bowt.ie>
Cc: Jinho Jung <jinhojun@usc.edu>
Cc: PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>
Subject: Re: Parallel query execution introduces performance regressions
Date: Mon, 1 Apr 2019 12:00:22 -0700
Message-ID: <20190401190022.ccugidpkncnckqli@alap3.anarazel.de> (raw)
In-Reply-To: <CAH2-Wz=wzQKkGBCRjB7f0yCo1ddPS7T3O51hHiQ1a63JnTpuyA@mail.gmail.com>
References: <CAF6pyKcGpbt3mgmVEZ-un3O8Y-Bo8FR-_2YTt0MF_c+-uCemKw@mail.gmail.com>
<CAH2-Wz=wzQKkGBCRjB7f0yCo1ddPS7T3O51hHiQ1a63JnTpuyA@mail.gmail.com>
Hi,
On 2019-04-01 11:52:54 -0700, Peter Geoghegan wrote:
> On Mon, Apr 1, 2019 at 11:30 AM Jinho Jung <jinhojun@usc.edu> wrote:
> > Surprisingly, we found that even on a larger TPC-C database (scale factor of 50, roughly 4GB of size), parallel scan is still slower than the non-parallel execution plan in the old version.
>
> That's not a large database, and it's certainly not a large TPC-C
> database. If you attempt to stay under the spec's maximum
> tpmC/throughput per warehouse, which is 12.86 tpmC per warehouse, then
> you'll need several thousand warehouses on modern hardware. We're
> talking several hundred gigabytes. Otherwise, as far as the spec is
> concerned you're testing an unrealistic workload. There will be
> individual customers that make many more purchases than is humanly
> possible. You're modelling an app involving hypothetical warehouse
> employees that must enter data into their terminals at a rate that is
> not humanly possible.
I don't think that's really the problem here. It's that there's a
fundamental misestimation in the query:
> [OLD version]
> Nested Loop Semi Join (cost=0.00..90020417940.08 rows=30005835 width=8)
> (actual time=0.034..24981.895 rows=90017507 loops=1)
> Join Filter: (ref_0.ol_d_id <= ref_1.i_im_id)
> -> Seq Scan on order_line ref_0 (cost=0.00..2011503.04 rows=90017504
> width=12) (actual time=0.022..7145.811 rows=90017507 loops=1)
> -> Materialize (cost=0.00..2771.00 rows=100000 width=4) (actual
> time=0.000..0.000 rows=1 loops=90017507)
> -> Seq Scan on item ref_1 (cost=0.00..2271.00 rows=100000 width=4)
> (actual time=0.006..0.006 rows=1 loops=1)
note the estimated rows=100000 vs the actual rows=1 in the seqscan /
materialize. That's what makes the planner think this is much more
expensive than it is, which in turn triggers the use of a parallel scan.
Greetings,
Andres Freund
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: andres@anarazel.de, pg@bowt.ie, jinhojun@usc.edu
Subject: Re: Parallel query execution introduces performance regressions
In-Reply-To: <20190401190022.ccugidpkncnckqli@alap3.anarazel.de>
References: <CAF6pyKcGpbt3mgmVEZ-un3O8Y-Bo8FR-_2YTt0MF_c+-uCemKw@mail.gmail.com> <CAH2-Wz=wzQKkGBCRjB7f0yCo1ddPS7T3O51hHiQ1a63JnTpuyA@mail.gmail.com> <20190401190022.ccugidpkncnckqli@alap3.anarazel.de>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox