Reputation: 3
select optimizer;
it returns
SELECT: identifier 'optimizer' unknown
What's the problem with it? And I can't find the sys table in the database using \d.
Upvotes: 0
Views: 107
Reputation: 1271
Concerning your second question,
You also have to create and add an optimizer pipeline to opt_pipes.c
. Look for the default_pipe
and then copy/paste that one to a new pipeline and add your optimizer to it.
There are some more places where you might need to add your optimizer, like in the codes[]
array in opt_wrapper.c
. Just mimick one of the standard optimizers like "reorder"
.
Upvotes: 0
Reputation: 405
For your first question: if your current_schema
is not sys
, you need to use select sys.optimizer;
.
For your second question: the best existing example is probably in monetdb5/extras/mal_optimizer_template
. Next to that, it's basically checking the source code to see how other optimisers have been implemented. NB, although it doesn't often happen, the internals of MonetDB can change between (major) versions. I'd recomment you to use Oct2020 or newer.
Upvotes: 0
Reputation: 71
Since Oct2020, variables now have a schema (to keep it other SQL objects). In your session, 'sys' is not the session's schema, that's why it cannot find the 'optimizer' variable, the same for the tables.
In default branch (will be available in the next release) I added a "schema path" property on the user to search SQL objects besides the current session's schema. By default it includes the 'sys' schema.
Upvotes: 1