Fix optimize command and view resolver for unknown extensions. Fixes #4688
Merge pull request #4691 from alprs/fix/compile-view-undefined-index

Fix optimize command and view resolver for unknown extensions. Fixes #4688