Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hB2Ad-0006nz-GU for pgsql-bugs@arkaria.postgresql.org; Mon, 01 Apr 2019 19:00:35 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hB2Ab-0005ws-TI for pgsql-bugs@arkaria.postgresql.org; Mon, 01 Apr 2019 19:00:33 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hB2Ab-0005wY-Lm for pgsql-bugs@lists.postgresql.org; Mon, 01 Apr 2019 19:00:33 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hB2AX-0004ll-TT for pgsql-bugs@lists.postgresql.org; Mon, 01 Apr 2019 19:00:33 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id E7A40220BA; Mon, 1 Apr 2019 15:00:27 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Mon, 01 Apr 2019 15:00:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm1; bh=d4ntGJYQGdayOuTLqJJjHOW5JEC Yyl2g35sqfPte0ws=; b=ek1cpx6QrSK98VYSXHywfJHJqtIYlF+FBRoGnQ4gx7x Pm9l14ZOGioKKf9Ru/pM3wRzUPlVXMhJMQFK6XlAYVER/5q4z8ejmi3xpWwT+F8A UqjOk2thRQXha4T+DKis/vgJb/SGqLtkq5PdhfEMF72hJbJhHL6ltZz7/rTcP3my zg/wUdTopZ4D6UPQ6MUsXMHpsavH9mVMy8/qWNoC0eYv+430HNBmH6OQXEqeH14Y e8Ok4975IqHmBxLf3xq9VPCk12lgSFmVMthPPScstyveF077ttBD2n3gvXRMrynj tJzLgqS39pWhfUHCDyYHJKOgkSHPsgJ1xyDC+g6DESQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=d4ntGJ YQGdayOuTLqJJjHOW5JECYyl2g35sqfPte0ws=; b=1+C1jUXxs5eiPw937bjWe9 8zkhxiwe22brCHKterugXakclkRYmqnz+aft3BHjNJ+90kOad/VdPDQ0e0BAOif7 z+3Z9A0lwHcCrNkxpE4GQW+Lq2wC++8v+WMRxyCQBihkFJ0BUrHG1QEXUD0r/Ouz grrTbDcIKiyt5KQW4psfmXO81iB9geluEePKZlXII45sNvG8fxhci4YkExm959Eo 3shdyz83AdTorQCuaoc2q84ooC60xfVKE25zgoeYYnZq8dNKTQKijCXDVe4ai/2N 0IyuKFWvs7oauDKc3eY67JwC/JLj/b51AxwKOwdgkOYxBlu5xkWFVeGFSpHWuFTA == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedutddrleeggdduvdelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfhfgggtuggjsehttdertddttddvnecuhfhrohhmpeetnhgurhgv shcuhfhrvghunhguuceorghnughrvghssegrnhgrrhgriigvlhdruggvqeenucfkpheple ekrddvuddtrddugedtrddujedunecurfgrrhgrmhepmhgrihhlfhhrohhmpegrnhgurhgv shesrghnrghrrgiivghlrdguvgenucevlhhushhtvghrufhiiigvpedt X-ME-Proxy: Received: from intern.anarazel.de (c-98-210-140-171.hsd1.ca.comcast.net [98.210.140.171]) by mail.messagingengine.com (Postfix) with ESMTPA id 83B03E442F; Mon, 1 Apr 2019 15:00:25 -0400 (EDT) Date: Mon, 1 Apr 2019 12:00:22 -0700 From: Andres Freund To: Peter Geoghegan Cc: Jinho Jung , PostgreSQL mailing lists Subject: Re: Parallel query execution introduces performance regressions Message-ID: <20190401190022.ccugidpkncnckqli@alap3.anarazel.de> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hi, On 2019-04-01 11:52:54 -0700, Peter Geoghegan wrote: > On Mon, Apr 1, 2019 at 11:30 AM Jinho Jung 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