fix formula interfaces to accept dynamic queries since they can't always be optimized to static queries