{'fraction_non_alphanumeric': 0.017625231910946195, 'fraction_numerical': 0.00463821892393321, 'mean_word_length': 5.347058823529411, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Inferring Function Semantics to Optimize Queries

The goal of the COKO-KOLA project [10, 9] is to express rules of rule-based optimizers in a manner permitting verification with a theorem prover. In [10], we considered query transformations that were too general to be expressed with rewrite rules. In this paper, we consider the complementary issue of expressing query transformations that are too specifc for rewrite rules. Such transformations require rewrite rules to be supplemented with semantic conditions to guard rule firing. This work considers the expression of such transformations using conditional rewrite rules, and the expression of inference rules to guide the optimizer in deciding if semantic conditions hold. This work differs from existing work in semantic query optimization in that semantic transformations in our framework are verifiable with a theorem prover. Further, our use of inference rules to guide semantic reasoning makes our optimizer extensible in a manner that is complementary to the extensibility benefits of existing rule-based technology.