pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andres Freund <andres@anarazel.de>
To: David Rowley <dgrowleyml@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Scott Ribe <scott_ribe@elevated-dev.com>
Cc: PostgreSQL General <pgsql-general@lists.postgresql.org>
Subject: Re: bad JIT decision
Date: Tue, 28 Jul 2020 14:07:48 -0700
Message-ID: <20200728210748.heyfzf7uv6n5ot3k@alap3.anarazel.de> (raw)
In-Reply-To: <CAApHDvrAnkzsyY-jkcgrh-WFFGmLH5A7g+Odo0cVJq2-S311-Q@mail.gmail.com>
References: <7736C40E-6DB5-4E7A-8FE3-4B2AB8E22793@elevated-dev.com>
	<CAApHDvoGfCqiF-20k4OLgawyubezBbpBpdfJ0SuphbbK0KEVUw@mail.gmail.com>
	<629715.1595630222@sss.pgh.pa.us>
	<CAApHDvoFsWpkwt+pKuuswChC+6EKQO+FfwicTQpSfTXAHDfoZw@mail.gmail.com>
	<CAApHDvooanQOWLLcxStyqrCY9UAmxN35+e=EV=h-4r8XiCBUGA@mail.gmail.com>
	<673332.1595688858@sss.pgh.pa.us>
	<20200727230007.rpknq77f7aaiufq2@alap3.anarazel.de>
	<CAApHDvrAnkzsyY-jkcgrh-WFFGmLH5A7g+Odo0cVJq2-S311-Q@mail.gmail.com>

Hi,

On 2020-07-28 11:54:53 +1200, David Rowley wrote:
> Is there some reason that we can't consider jitting on a more granular
> basis?

There's a substantial "constant" overhead of doing JIT. And that it's
nontrival to determine which parts of the query should be JITed in one
part, and which not.


> To me, it seems wrong to have a jit cost per expression and
> demand that the plan cost > #nexprs * jit_expr_cost before we do jit
> on anything.  It'll make it pretty hard to predict when jit will occur
> and doing things like adding new partitions could suddenly cause jit
> to not enable for some query any more.

I think that's the right answer though:

> ISTM a more granular approach would be better. For example, for the
> expression we expect to evaluate once, there's likely little point in
> jitting it, but for the one on some other relation that has more rows,
> where we expect to evaluate it 1 billion times, there's likely good
> reason to jit that.  Wouldn't it be better to consider it at the
> RangeTblEntry level?

Because this'd still JIT if a query has 10k unconditional partition
accesses with the corresponding accesses, even if they're all just one
row?

(I'm rebasing my tree that tries to reduce the overhead / allow caching
/ increase efficiency to current PG, but it's a fair bit of work)

Greetings,

Andres Freund





view thread (26+ messages)  latest in thread

Message-ID: <20200728210748.heyfzf7uv6n5ot3k@alap3.anarazel.de>
Permalink:  ../20200728210748.heyfzf7uv6n5ot3k@alap3.anarazel.de/
Also on:    postgresql.org/message-id/20200728210748.heyfzf7uv6n5ot3k@alap3.anarazel.de

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: andres@anarazel.de, dgrowleyml@gmail.com, tgl@sss.pgh.pa.us, scott_ribe@elevated-dev.com
  Subject: Re: bad JIT decision
  In-Reply-To: <20200728210748.heyfzf7uv6n5ot3k@alap3.anarazel.de>
  References: <7736C40E-6DB5-4E7A-8FE3-4B2AB8E22793@elevated-dev.com> <CAApHDvoGfCqiF-20k4OLgawyubezBbpBpdfJ0SuphbbK0KEVUw@mail.gmail.com> <629715.1595630222@sss.pgh.pa.us> <CAApHDvoFsWpkwt+pKuuswChC+6EKQO+FfwicTQpSfTXAHDfoZw@mail.gmail.com> <CAApHDvooanQOWLLcxStyqrCY9UAmxN35+e=EV=h-4r8XiCBUGA@mail.gmail.com> <673332.1595688858@sss.pgh.pa.us> <20200727230007.rpknq77f7aaiufq2@alap3.anarazel.de> <CAApHDvrAnkzsyY-jkcgrh-WFFGmLH5A7g+Odo0cVJq2-S311-Q@mail.gmail.com> <20200728210748.heyfzf7uv6n5ot3k@alap3.anarazel.de>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox