Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lBuAG-0004zk-4y for pgsql-general@arkaria.postgresql.org; Tue, 16 Feb 2021 06:48:52 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lBuAC-0004fp-Ou for pgsql-general@arkaria.postgresql.org; Tue, 16 Feb 2021 06:48:48 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lBuAC-0004ed-GX for pgsql-general@lists.postgresql.org; Tue, 16 Feb 2021 06:48:48 +0000 Received: from portal-smtp-out.hot.ee ([194.126.101.125]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lBuA9-0006H9-B9 for pgsql-general@postgresql.org; Tue, 16 Feb 2021 06:48:48 +0000 Received: from localhost (localhost [127.0.0.1]) by vm-hot-relay10.estpak.ee (Postfix) with ESMTP id DEFE21CDC for ; Tue, 16 Feb 2021 08:48:43 +0200 (EET) X-Virus-Scanned: Debian amavisd-new at vm-hot-relay10.estpak.ee Received: from portal-smtp-out.hot.ee ([127.0.0.1]) by localhost (vm-hot-relay10.estpak.ee [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ojOzAx-f86Qb for ; Tue, 16 Feb 2021 08:48:39 +0200 (EET) Received: from mail.hot.ee (hot-relayhost3.estpak.ee [213.180.2.81]) by vm-hot-relay10.estpak.ee (Postfix) with ESMTP id 6B1A71D62 for ; Tue, 16 Feb 2021 08:48:39 +0200 (EET) To: pgsql-general@postgresql.org From: Andrus Subject: Turn jit off for slow subquery in Postgres 12 Message-ID: Date: Tue, 16 Feb 2021 08:48:35 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="------------33F34BC62BE4BB1DE68E8D87" Content-Language: et List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk This is a multi-part message in MIME format. --------------33F34BC62BE4BB1DE68E8D87 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Hi! Last year I posted testcase [1] which shows that using jit makes execution magnitude slower ( 2.5s vs 0.4 sec) in typical shopping cart application product search in Postgres 12. There are also other reports on this [2,3]. I tried to turn jit off for subquery using select ...  from ( set jit to off; select ... from cartdata, ...  where .... set jit to on ) But this cause syntax error. How to turn off jit for specific subquery in Postgres 12 ? Subquery is generated by EF Core and splitting it to multiple statements is not possible. Postgres upgrade is not planned. Andrus. [1] https://www.postgresql.org/message-id/A2E2572094D4434CAEB57C80085B22C7@dell2 [2] https://www.postgresql.org/message-id/CAHOFxGo5xJt02RmwAWrtv2K0jcqqxG-cDiR8FQbvb0WxdKhcgw%40mail.gmail.com [3]https://www.postgresql.org/message-id/629715.1595630222%40sss.pgh.pa.us --------------33F34BC62BE4BB1DE68E8D87 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit

Hi!

Last year I posted testcase [1] which shows that using jit makes execution
magnitude slower ( 2.5s vs 0.4 sec) in typical shopping cart application product search in Postgres 12.

There are also other reports on this [2,3].

I tried to turn jit off for subquery using

select ...  from
(
set jit to off;
select ... from cartdata, ...  where ....
set jit to on
)

But this cause syntax error.

How to turn off jit for specific subquery in Postgres 12 ?

Subquery is generated by EF Core and splitting it to multiple statements is not possible.

Postgres upgrade is not planned.

Andrus.

[1] https://www.postgresql.org/message-id/A2E2572094D4434CAEB57C80085B22C7@dell2
[2] https://www.postgresql.org/message-id/CAHOFxGo5xJt02RmwAWrtv2K0jcqqxG-cDiR8FQbvb0WxdKhcgw%40mail.gmail.com
[3]https://www.postgresql.org/message-id/629715.1595630222%40sss.pgh.pa.us

--------------33F34BC62BE4BB1DE68E8D87--