Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fsXGh-0004DF-T3 for pgsql-hackers@arkaria.postgresql.org; Wed, 22 Aug 2018 17:50:08 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fsXGe-00010N-MB for pgsql-hackers@arkaria.postgresql.org; Wed, 22 Aug 2018 17:50:04 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fsXGe-0000zC-3S for pgsql-hackers@lists.postgresql.org; Wed, 22 Aug 2018 17:50:04 +0000 Received: from post.visena.com ([46.226.10.50]) by makus.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1fsXGW-0007Md-SU for pgsql-hackers@lists.postgresql.org; Wed, 22 Aug 2018 17:50:02 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=visena.com; s=20141101.wh; h=Content-Type:MIME-Version:Subject:In-Reply-To:Message-ID:Cc:To:From:Date; bh=WNSLaPSJjpQGLWvjYETC5q2gtTUNMZ6wvbsDjd/X1mk=; b=YqKIGWifprfPAt/7ReDjl2SRM3oJqbjxHBXNtrnFF5/UwC+W6ghgSZR5nt0ih69yRmfxLAylfFv4HrwABfYNhZn7Q4hx9GJU/TD1B6nhMHBZCsYlD09rRmqOtTr1/pBLf+E0WWYd1/1RiG71GQ4Mt1Kz7iH0JfvE3QoW/prKXrc=; Received: from [10.0.1.10] (helo=tc7-visena.wh.internal.visena.com) by post.visena.com with esmtp (Exim 4.82) (envelope-from ) id 1fsXGN-0000yc-Ky; Wed, 22 Aug 2018 19:49:49 +0200 Received: from localhost ([127.0.0.1] helo=tc7-visena.wh.internal.visena.com) by tc7-visena.wh.internal.visena.com with esmtp (Exim 4.86_2) (envelope-from ) id 1fsXHk-00019X-DE; Wed, 22 Aug 2018 19:51:12 +0200 Date: Wed, 22 Aug 2018 19:51:12 +0200 (CEST) From: Andreas Joseph Krogh To: Andres Freund Cc: Robert Haas , Alvaro Herrera , "Jonathan S. Katz" , PostgreSQL Hackers Message-ID: In-Reply-To: <20180822165155.tjbib4pewnbiyy4x@alap3.anarazel.de> Subject: Sv: Re: Query is over 2x slower with jit=on MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_170_1135327557.1534960272317" X-Mailer: Visena Mail 2.1.103 X-Spam-Score: -1.0 X-Spam-Report: SpamAssasin (score=-1.0, required 5.0 ALL_TRUSTED=-1,HTML_MESSAGE=0.001) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk ------=_Part_170_1135327557.1534960272317 Content-Type: multipart/related; boundary="----=_Part_171_348906196.1534960272317" ------=_Part_171_348906196.1534960272317 Content-Type: multipart/alternative; boundary="----=_Part_172_1768968657.1534960272330" ------=_Part_172_1768968657.1534960272330 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable P=C3=A5 onsdag 22. august 2018 kl. 18:51:55, skrev Andres Freund >: On 2018-08-22 18:39:18 +0200, Andreas Joseph Krogh wrote: > Just to be clear; The query=C2=A0really=C2=A0runs slower (wall-clock tim= e), it's not > just the timing. I bet it's not actually running slower, it "just" takes longer to start up due to the JITing in each worker. I suspect what we should do is to multiple the cost limits by the number of workers, to model that.=C2=A0 Bu= t without the fixed instrumentation that's harder to see... =C2=A0 Well, yes, that might be. By "runs" I meant from me hitting ENTER in psql t= o=20 the time the query finishes... =C2=A0 I thought=C2=A0JITing of prepared=C2=A0queries happended once (in "prepare"= )=C2=A0so it=20 didn't have to do the JITing every time the query is executed. Isn't=20 the=C2=A0previously generated bytecode usable for subsequent queries? =C2=A0 -- Andreas Joseph Krogh ------=_Part_172_1768968657.1534960272330 Content-Type: text/html;charset=UTF-8 Content-Transfer-Encoding: quoted-printable
P=C3=A5 onsdag 22. august 2018 kl. 18:51:55, skrev Andres Freund <<= a href=3D"mailto:andres@anarazel.de">andres@anarazel.de>:
On = 2018-08-22 18:39:18 +0200, Andreas Joseph Krogh wrote:
> Just to be clear; The query=C2=A0really=C2=A0runs slower (wall-clock t= ime), it's not
> just the timing.

I bet it's not actually running slower, it "just" takes longer to= start
up due to the JITing in each worker. I suspect what we should do is to
multiple the cost limits by the number of workers, to model that.=C2=A0 But=
without the fixed instrumentation that's harder to see...
=C2=A0
Well, yes, that might be. By "runs" I meant from me hitting = ENTER in psql to the time the query finishes...
=C2=A0
I thought=C2=A0JITing of prepared=C2=A0queries happended once (in &quo= t;prepare")=C2=A0so it didn't have to do the JITing every time the que= ry is executed. Isn't the=C2=A0previously generated bytecode usable for sub= sequent queries?
=C2=A0
">
--
Andreas Joseph Krogh
------=_Part_172_1768968657.1534960272330-- ------=_Part_171_348906196.1534960272317-- ------=_Part_170_1135327557.1534960272317--