JIT overhead slowdown

From: Luis Carril <luis(dot)carril(at)swarm64(dot)com>
To: "pgsql-performance(at)lists(dot)postgresql(dot)org" <pgsql-performance(at)lists(dot)postgresql(dot)org>
Subject: JIT overhead slowdown
Date: 2019-01-18 14:12:23
Message-ID: LEXPR01MB09897821BA2CDDB70225EF7BE79C0@LEXPR01MB0989.DEUPRD01.PROD.OUTLOOK.DE
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Hello,

we noticed that in the presence of a schema with many partitions the jitting overhead penalizes the total query execution time so much that the planner should have decided not to jit at all. For example without jitting we go a 8.3 s execution time and with jitting enabled 13.8 s.

Attached you can find the TPC-h schema, a query to trigger it and the plans that we obtained.

Setup:

Current master from PSQL git repo, only compiled with llvm

TPC-h schema attached, plus a single index per table, and a scale factor of 10. Tables where analyzed.

The query is variation of query 12 to make the effect more relevant.

Max_workers_per_gather is 8

And we only vary the jit flag, we do not modify the costs.

Is this behavior expected? Is the cost function for jitting missing some circumstances?

Cheers
Luis

Dr. Luis M. Carril Rodríguez
Senior Software Engineer
luis(dot)carril(at)swarm64(dot)com<mailto:lisa(at)swarm64(dot)com>

Swarm64 AS
Parkveien 41 B | 0258 Oslo | Norway
Registered at Brønnøysundregistrene in Norway under Org.-Number 911 662 787
CEO/Geschäftsführer (Daglig Leder): Dr. Karsten Rönner; Chairman/Vorsitzender (Styrets Leder): Dr. Sverre Munck

Swarm64 AS Zweigstelle Hive
Ullsteinstr. 120 | 12109 Berlin | Germany

Registered at Amtsgericht Charlottenburg - HRB 154382 B

[cid:6213a8cc-8698-4af8-a8ac-7e2b6f201592]

Attachment Content-Type Size
tpch-schema-part.sql application/sql 2.8 KB
12-jit-slow.sql application/sql 1.3 KB
plan-jit.txt text/plain 48.6 KB
plan-no-jit.txt text/plain 46.8 KB

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Andres Freund 2019-01-18 16:42:54 Re: JIT overhead slowdown
Previous Message Etsuro Fujita 2019-01-18 12:55:28 Re: Query with high planning time at version 11.1 compared versions 10.5 and 11.0