timescaledb icon indicating copy to clipboard operation
timescaledb copied to clipboard

[Feature]: Investigate posibility to disable JIT in query planner hook

Open antekresic opened this issue 1 year ago • 1 comments

What problem does the new feature solve?

For certain hypertable queries, JIT compiler causes performance regressions. This is a known Postgres problem which also happens with native partitioning. There have been past attempts to improve the situations but no progress has been made.

There is a possibility for us to disable JIT from the query planner hook so at least we don't hit this performance regression. Its not clear whether this could affect rest of the queries so an investigation is necessary before proceeding to implement this.

What does the feature do?

Disables JIT compilation for certain queries which have performance regressions due to a known PG problem. We should also expose a GUC to let users enable JIT if they really want to do that.

Implementation challenges

No response

antekresic avatar Sep 28 '23 08:09 antekresic

Wow, our production database seemed to randomly start slugging. Queries were taking magnitudes longer than expected. Queries were using JIT. Disabling JIT on all queries brought things back to the speed we expected.

I don't know what was going through the query planner's head. I don't recall changing anything before JIT took control. Bad JIT.

jacobpake avatar Mar 15 '24 01:03 jacobpake