4 ms·
I wonder how hard it would be to give Postgres a pluggable query planner, so that extensions can try to improve on its results. Then people could try things out
by pjungwir 9y ago
I wonder how hard it would be to give Postgres a pluggable query planner, so that extensions can try to improve on its results. Then people could try things out without Postgres committing to something too soon.
I'm still learning what Postgres extensions are capable of. I've written a few but only to define functions & types. It seems like I've seen more "interesting" achievements though, like CitusDB seems able to rewrite queries. Can an extension even add syntax?
EDIT: This seems to be the important part: https://github.com/citusdata/citus/blob/master/src/backend/distributed/shared_library_init.c https://github.com/citusdata/citus/blob/master/src/backend/d...
I wonder what `planner_hook` is about. . . .
- anarazel 9y ago> I wonder how hard it would be to give Postgres a pluggable query planner, so that extensions can try to improve on its results. Then people could try things out without Postgres committing to something too soon. You can quite easily replace the planner, it's just a single hook. Building a replacement's the hard part ;) > Can an extension even add syntax? No, not really. There's no good way to achieve extensibility with a bison based parser. At least none that we PG devs know and "believe" in.