Open sjwiesman opened 3 months ago
This is working as designed, I'm afraid. I agree it's somewhat hard to explain, but autorouting only kicks in for "cheap" queries, and our definition of "cheap" is "100% guaranteed to be executable without involving the compute layer". mz_is_superuser()
is unmaterializable, and so we can execute entirely it in the adapter, but SELECT mz_is_superuser() IS FALSE
involves calling the IS FALSE
operator, which lives in compute, and therefore we aren't certain that it is "cheap." (Obviously in this case it's a bit silly, as IS FALSE
is obviously cheap, but with something like generate_series(1, 1000)
it becomes clearer. Whether that's cheap our not depends on how large the series is, and that threshold moves around over time, and we don't want autorouting to depend on what the optimizer's current threshold for "cheap" is.)
What version of Materialize are you using?
v0.96.2
What is the issue?
For whatever reason, this autoroutes to mz_introspection:
But this does not.
I didn't dig into this, and is likely not urgent, but documenting for later.