News for hackers. Stuff that matters.
Re:Look ma, I wrote a new JIT compiler for PostgreSQL by williamdclt on Monday March 18, 2024 @09:46AM (#39744438)
(The article goes a bit above my head so my excuses if I am a bit off-topic)

There is a form of query plan caching in PG: for prepared statements, if PG determines that the actual value of parameters won't affect the query plan much, it uses a "generic plan" so that it reuses the same query plan for every execution of the prepared statement (https://www.postgresql.org/docs/current/sql-prepare.html, see "notes")

Re:Look ma, I wrote a new JIT compiler for PostgreSQL by pinaraf on Monday March 18, 2024 @09:49AM (#39744480)
Indeed, and right now it's the only possible way since it remains in a single session, doing otherwise would be very hard.
Re:Look ma, I wrote a new JIT compiler for PostgreSQL by cbsmith on Monday March 18, 2024 @12:39PM (#39746719)
Unless you count stored procs...
Re:Look ma, I wrote a new JIT compiler for PostgreSQL by SigmundA on Monday March 18, 2024 @11:15AM (#39745694)
Yes its manual and per session, DB's like MSSQL have that was well but are very rarely used anymore because it got automatic plan caching about 20 years ago which basically eliminates any advantage to manually preparing. Its actually better since it can be shared across all sessions