2 ms·
> I've often wondered why queries weren't be compiled to native code to remove interpreter overhead. It's not entire queries that are JITed at this point, it's
by anarazel 9y ago
> I've often wondered why queries weren't be compiled to native code to remove interpreter overhead.
It's not entire queries that are JITed at this point, it's just a subset of the work. WHERE clauses are, but the logic around joins, just as an example, are not. Partially because it's a lot of work to do more, partially because it's often not very beneficial and you end up spending more time emitting & optimizing JITed code than you save.
> I imagine that overhead must not have been particularly low hanging fruit until recently.
I think it's largely because it's a huge project. I've spent a good chunk of two release cycles (a year each) on it. Not that easy to get an employer (or two as in my case) to sponsor work of that size. Thankfully both Citus and EnterpriseDB were willing to do so.
Hopefully now that the infrastructure is in we can JIT more things in smaller patches.