https://github.com/higuoxing/pg_slowjit
A simple demo to illustrate how to implement a JIT provider for PostgreSQL.
https://github.com/higuoxing/pg_slowjit
jit postgresql postgresql-extension
Last synced: 10 months ago
JSON representation
A simple demo to illustrate how to implement a JIT provider for PostgreSQL.
- Host: GitHub
- URL: https://github.com/higuoxing/pg_slowjit
- Owner: higuoxing
- Created: 2023-10-31T15:03:31.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-11-14T09:22:57.000Z (over 2 years ago)
- Last Synced: 2025-01-11T09:42:17.525Z (over 1 year ago)
- Topics: jit, postgresql, postgresql-extension
- Language: C
- Homepage: https://higuoxing.com/archives/implementing-jit-provider-for-pgsql
- Size: 13.7 KB
- Stars: 10
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# pg_slowjit
> A simple demo to illustrate how to implement a JIT provider for PostgreSQL. `pg_slowjit` emits C codes and compile them to shared libraries in runtime. This project is inspired by [09 - Query Compilation & JIT Code Generation (CMU Advanced Databases / Spring 2023)](https://www.youtube.com/watch?v=eurwtUhY5fk).
## What does it support?
Currently, it only supports jitting a few operators. You can use it to jit the query `SELECT 1;`.
```
postgres=# EXPLAIN (SETTINGS ON) SELECT 1;
QUERY PLAN
---------------------------------------------------------------------------------
Result (cost=0.00..0.01 rows=1 width=4)
Settings: jit_above_cost = '0'
JIT:
Functions: 1
Options: Inlining false, Optimization false, Expressions true, Deforming true
(5 rows)
```