4 ms·
Oracle should keep statistics on the queries it gets and infer which of the parameters should be treated as bound parameters in a reusable query plan. I wonder
by ntoshev 17y ago
Oracle should keep statistics on the queries it gets and infer which of the parameters should be treated as bound parameters in a reusable query plan. I wonder why it doesn't. It would still need to parse queries, but I believe making the query plan is the expensive part. Also parsing could be done by the client machine's driver.
- msluyter 17y agoSo, you're saying given queries like: select * from t where t.col = 'foo' select * from t where t.col = 'bar' select * from t where t.col = 'baz' Oracle should infer that foo|bar|baz should be parameterized? Interesting idea, though this seems like matter of matching parse trees, and I believe that's a relatively expensive operation, roughly polynomial time, iirc.
- ntoshev 17y agoYou don't have to infer all semantically equivalent queries, comparing queries as linear streams of tokens should do.