Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1f1dDU-0005MW-KL for pgsql-hackers@arkaria.postgresql.org; Thu, 29 Mar 2018 19:28: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 1f1dDS-0000Iq-Gu for pgsql-hackers@arkaria.postgresql.org; Thu, 29 Mar 2018 19:28:06 +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_SHA384:256) (Exim 4.89) (envelope-from ) id 1f1dDR-0000Ih-B4 for pgsql-hackers@lists.postgresql.org; Thu, 29 Mar 2018 19:28:06 +0000 Received: from out5-smtp.messagingengine.com ([66.111.4.29]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1f1dDM-0005Od-Ax for pgsql-hackers@lists.postgresql.org; Thu, 29 Mar 2018 19:28:04 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 5399420EA6; Thu, 29 Mar 2018 15:27:58 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Thu, 29 Mar 2018 15:27:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= cc:content-type:date:from:in-reply-to:message-id:mime-version :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=wReZylg9xn8Cw+LywSJk+XWCG22FlFJYOUSIM/BYtSs=; b=Ityqo4/Q yBx4NxmocHuEUsM30U/jXVmVAQr+zAerCsy7NS8f3G9xa6xg/J92A2YkUdjiFIlb fy2hPgW9cqmyGOs3AV77Y9xJNrqUSrBZDDgZxiDtj6dHg1uv3WF9GdSkoNlRtQ42 cTVf2v7STDa6T73Bzs+SK//cubHXtRUntWic3qFQjMZtVAhpfEV8b02DDOmXUc6w dehWdLIjeW2CSwMNlnG53CDPxwvwsG8zyuYoAjJYHbA/KHCkfy45fXzj03vfmWD9 FBLRdv4nIRqw70igM1kheyD+2vJm1T0K5dZbApTCjkqnkAi7eIDyd0UQd7uDUpfZ DKylEEsA1w2WUw== 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-sender :x-me-sender:x-sasl-enc; s=fm2; bh=wReZylg9xn8Cw+LywSJk+XWCG22Fl FJYOUSIM/BYtSs=; b=a0anSltcp5Pk42Bv0pnHRNpYc8lLWOBMA2rfC9l7hoQMZ ETuWG7qkP6dUUc2jIyFZ2HhMpj/4PM3Nf8cua/OmAlwaJPQeMmO0DMrnCqFjSIPq pOnsII0SmONxNHPOlaqaw9Dat1JzfyOGGVUw4J7NJh8VpJbHZRSGhm0t9V3fKp65 iCSAeO757bFOPrOVWyjUhwuWRk5vc1FcffkBpOjGBO8KFVI4rtGfeai2WVTGETXL KXaokoTHXFrgFEMEGu1AlaQDMMrKHNFKtLApmiDsmOJB48lr+ZIsziKZPx1U/bPL P16lP2/nSrc/ibk5agol49aC6Ntzi5YX7dHoP7PpA== X-ME-Sender: Received: from intern.anarazel.de (unknown [136.24.76.189]) by mail.messagingengine.com (Postfix) with ESMTPA id 0E471E507D; Thu, 29 Mar 2018 15:27:58 -0400 (EDT) Date: Thu, 29 Mar 2018 12:27:57 -0700 From: Andres Freund To: Stephen Frost Cc: Robert Haas , Tom Lane , Alvaro Herrera , Simon Riggs , PostgreSQL Hackers Subject: Re: pgsql: Add documentation for the JIT feature. Message-ID: <20180329192757.h5iwqpfipwwj6xfx@alap3.anarazel.de> References: <20180329125955.7utz5ergjp2oxhwy@alvherre.pgsql> <13592.1522331090@sss.pgh.pa.us> <20180329180116.xvselrjpzk5fjul5@alap3.anarazel.de> <20180329190036.GP24540@tamriel.snowman.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180329190036.GP24540@tamriel.snowman.net> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2018-03-29 15:00:36 -0400, Stephen Frost wrote: > Greetings, > > * Andres Freund (andres@anarazel.de) wrote: > > On 2018-03-29 13:26:31 -0400, Robert Haas wrote: > > > On Thu, Mar 29, 2018 at 9:44 AM, Tom Lane wrote: > > > > I'd go a little further and drop "JIT" from user-facing documentation > > > > altogether. Instead refer to the feature as "compilation of expressions" > > > > or some such. JIT is just jargon. Plus, the timing of the compilation is > > > > actually the least important property for our purpose. > > > > > > I agree that talking about JIT compilation (or just-in-time > > > compilation) would be better than talking just about JIT, but refusing > > > to mention JIT seems counter-productive to me. There are a lot of > > > people who know what just-in-time compilation is and will not realize > > > that "compilation of expressions" refers to any such technology. If > > > you don't know what it is, you can Google it. Just typing "jit" into > > > Google produces a stupid urban dictionary hit and then this: > > > https://en.wikipedia.org/wiki/Just-in-time_compilation -- and that > > > contains useful information that you'll never find if you search for > > > "compilation of expressions". > > > > > > Also, in a way, you could argue that v10 already did "compilation of > > > expressions". It didn't compile them to machine language, true, but > > > it translated them into a form which is faster to execute, and which > > > is at least arguably a form of bytecode. It's not going to be clear, > > > even to an expert, that "compilation of expressions" means something > > > other than that, but if you say JIT, then all of a sudden people know > > > what we're talking about. > > > > > > I agree that JIT is jargon, but it's pretty commonly-used jargon. > > > > Precisely this. I'm very strongly against just saying "expression > > compilation", it's just too imprecise. As Robert mentions it could refer > > to what we do in v10, it could refer to ahead of time compilation of PL > > functions, and it doesn't include compiling tuple deforming. Nor will > > it describe compiling sorting, copy or whatnot. > > > > I'm very open however to replacing JITing with JIT compiling and smilar > > substitutions. > > What we've done elsewhere when there's been similar jargon is to say > something along the lines of: > > "compiling of routines (also known as Just-In-Time or JIT compilation)" There's an entire section explaining what JIT is and what we currently can JIT. We can't just say "compiling of routines (also ...)", because a) we don't do that. b) even if you take expressions being JIT compiled as that, we also JIT compile tuple deforming. And hopefully will JIT further things in the not too far away future. The general config.sgml references and such read Sets the planner's cutoff above which JIT compilation is used as part of query execution (see ). Performing JIT costs time but can accelerate query execution. it's not used in a standalone manner without references. and the jit specific section starts with: Just-in-time compilation (JIT) is the process of turning some form of interpreted program evaluation into a native program, and doing so at runtime. For example, instead of using a facility that can evaluate arbitrary SQL expressions to evaluate an SQL predicate like WHERE a.col = 3, it is possible to generate a function than can be natively executed by the CPU that just handles that expression, yielding a speedup. and continues a bit later with <acronym>JIT</acronym> Accelerated Operations Currently PostgreSQL's JIT implementation has support for accelerating expression evaluation and tuple deforming. Several other operations could be accelerated in the future. Expression evaluation is used to evaluate WHERE clauses, target lists, aggregates and projections. It can be accelerated by generating code specific to each case. Tuple deforming is the process of transforming an on-disk tuple (see ) into its in-memory representation. It can be accelerated by creating a function specific to the table layout and the number of columns to be extracted. I think there's a few references to standalone JIT that deserve to be replaced with JIT compilation and similar. Greetings, Andres Freund