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 1h1bLk-0006zJ-KK for pgsql-performance@arkaria.postgresql.org; Wed, 06 Mar 2019 18:33:04 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1h1bLi-0005Sy-J5 for pgsql-performance@arkaria.postgresql.org; Wed, 06 Mar 2019 18:33:02 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h1bLi-0005Sd-7h for pgsql-performance@lists.postgresql.org; Wed, 06 Mar 2019 18:33:02 +0000 Received: from out2-smtp.messagingengine.com ([66.111.4.26]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h1bLf-0001JR-RQ for pgsql-performance@lists.postgresql.org; Wed, 06 Mar 2019 18:33:01 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 14576220A3; Wed, 6 Mar 2019 13:32:59 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Wed, 06 Mar 2019 13:32:59 -0500 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=KueGjcmtNirLJmN6akAN9OMq/LL WMtWhJWajm7nFTLg=; b=FGuURg+JNjnOeCP10ki/BQf8jAfBlLpxZGPUdZdZk0A KYijjPTq/U4nIPwviRvK/300MlpoAsWpF61DbjDxRDM0kwGPsgmxQqCPyxKO/uj3 JbBDnhSk+VH4jW8ouj+iaGcC1KSjsxPLUBBKPdiNjQ0LchtNpwVRpCm0zf1uuTLN yXqMf9/ZD8aALpbvvyAk9VVMq8lRxq2WfkunI620WQ+yx9L6XmpOYPgWWn8xkkjf jcg58b/5plB0RycX3eWw+tUc07EdTmjz9UUS2YKsK985n2WC4Ludgj80RAtyBFpV C9Ro+TZli1uaaIUQVH+QUIHstD8DYxqkE9etXp+OG5w== 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=KueGjc mtNirLJmN6akAN9OMq/LLWMtWhJWajm7nFTLg=; b=Mft4bzvt6kGcJWwhGJpz9f tZFre9P0jljTsaKVkiPKDCxWmRu+cjsshj/u7ngmHFCbKYU/G33i7TEws8Ajbcq7 GQsGbr4Nblej9fc9DyIUxJVA3wLxMhRLVPg2cGpFaPfosyYOI1ZTziybe1+naWSd 1/rKg6A/2ofA7DFwCwKMOc0ysrw8XP1dogMlUQxYuAYyBDwMtf25yAuw8kNN5ltu NFqIlxISUGDBQtF+RPhW+Owi8bGEK/Utp5E9Y4ltkFZ+ukQrjBmmjCq9vQrbtRIA B6esOSEbXZ7K69VCInaLZBLN5lQy12nG4TEF/Uryhimnn5j5m+lBBgj0KRvw3yZw == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedutddrfeeigdehhecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvuffkfhggtggujgesthdtredttddtvdenucfhrhhomheptehnughrvghs ucfhrhgvuhhnugcuoegrnhgurhgvshesrghnrghrrgiivghlrdguvgeqnecukfhppeelke drvddutddrudegtddrudejudenucfrrghrrghmpehmrghilhhfrhhomheprghnughrvghs segrnhgrrhgriigvlhdruggvnecuvehluhhsthgvrhfuihiivgeptd 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 1372610310; Wed, 6 Mar 2019 13:32:58 -0500 (EST) Date: Wed, 6 Mar 2019 10:32:57 -0800 From: Andres Freund To: Tobias Gierke Cc: pgsql-performance@lists.postgresql.org Subject: Re: JIT performance question Message-ID: <20190306183257.lzdwpitvxehug3ag@alap3.anarazel.de> References: <6191e1ee-d548-2a8c-d87d-dab63c05ad2e@code-sourcery.de> <20190306174258.f23avt6k3vtgqsqr@alap3.anarazel.de> 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-03-06 19:21:33 +0100, Tobias Gierke wrote: > On 06.03.19 18:42, Andres Freund wrote: > > > > It's hard to know precisely without running a profile of the > > workload. My suspicion is that the bottleneck in this query is the use > > of numeric, which has fairly slow operations, including aggregation. And > > they're too complicated to be inlined. > > > > Generally there's definitely advantage in JITing aggregation. > > > > There's a lot of further improvements on the table with better JIT code > > generation, I just haven't gotten around implementing those :( > > Thanks for the quick response ! I think you're onto something with the > numeric type. I replaced it with bigint and repeated my test and now I get a > nice 40% speedup Cool. It'd really be worthwhile for somebody to work on adding fastpaths to the numeric code... Greetings, Andres Freund