Connect Orca via a planner hook - #1112
Conversation
b1c28a2 to
98b00ae
Compare
This comment was marked as resolved.
This comment was marked as resolved.
bandetto
left a comment
There was a problem hiding this comment.
Shouldn't we bring src/backend/gporca/.clang-format from original ORCA and use it in this extension as well?
It looks that current clang-format settings are targeted to cpp code mostly. On C code it may work not well, for example it spoils the C-style comments, like below: So for C code I'd rather use pgindent. Besides, it is not the 'core' Orca code. |
|
Seems like CI tests are skipped here, but locally, I can't find/create ORCA extension to CREATE and use it. Since there is no SQL file (like |
To use ORCA, it is enough to place it in shared libraries, no create extension was expected! |
|
Hm, I'm getting correct results: what steps do you use? |
Looks like the Maybe use something more robust than just sed? For example, a quick hack to get the previous GUC value and append ORCA to it: SHARED_LIBS=$(shell gpconfig -s shared_preload_libraries | sed -n '3s/.*Coordinator value: \(.*\)/\1/p')
install-gp-orca:
...
gpconfig -c shared_preload_libraries -m '$(SHARED_LIBS),gp_orca' |
puts in shared library in default config, any You should create new cluster to use it, while
puts in shared library in existing cluster |
I see. But I find this method fragile nonetheless. Maybe we should break it down? For example, check if there is already a cluster running, and if there is a uncommented |
It sounds like out of the scope of this ticket. If needed. |
Yeah, it does. I thought it should been noted. Maybe it would be good to have a README for these things. |
I think formatting is a separate task, moreover Line 67 in 72059d2 |
|
Connect Orca via a planner hook
Problem:
Orca's code was strongly coupled with the standard_planner() code. It introduced
difficulties for moving Orca's functionality into a shared lib.
This patch:
hook in gp_orca shared lib;
is done when the backend has already been initialized including its memory
protection means);
init (thus the deinit is done right before ShutdownPostgres() is called, where
it was before).