Regex Engine Compiled Code for Dictionary-Encoded Strings
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing database management systems face significant performance challenges when performing regular expression matching due to the compute-heavy nature of the task, which leads to increased memory usage and processing cycles, especially with larger input strings and more complex regex patterns.
Innovation Solution
The proposed solution involves generating specialized compiled code at runtime that is optimized for the specific regex pattern and input string, allowing the database management system to determine the most efficient execution logic based on descriptors provided to the regex engine. This approach includes converting a decoded-string automaton into an encoded-string automaton to enable regex matching without decoding the string, thereby reducing computational overhead.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Quantity of substance
If strings are encoded/compressed to reduce memory space, then memory usage is reduced, but decoding operations are required which consume additional compute resources
Solution Approach 1:
The automaton is pre-compiled into specialized machine code at runtime based on the regex pattern and input string characteristics. This preliminary compilation creates optimized execution logic that eliminates the need for decoding operations during regex matching, as the automaton operates directly on the encoded string tokens
Solution Approach 2:
The patent replaces the traditional decoding-then-matching mechanical process with a direct automaton execution on encoded strings. The regex engine substitutes the decoding mechanism with a token-based automaton that processes encoded string tokens directly, eliminating the harmful decoding step while maintaining matching accuracy
2Measurement precision
If regex operations are performed on decoded strings, then matching accuracy is maintained, but computational overhead increases due to decoding operations
Solution Approach 1:
The automaton is pre-compiled into specialized machine code at runtime based on the regex pattern and input string characteristics. This preliminary compilation creates optimized execution logic that eliminates the need for decoding operations during regex matching, as the automaton operates directly on the encoded string tokens
Solution Approach 2:
The patent changes the operational parameters of the regex engine by allowing it to work directly with encoded string tokens instead of decoded characters. The automaton transitions are defined based on token values rather than character values, fundamentally changing how the matching process operates while preserving accuracy
3Productivity
If specialized compiled code is generated at runtime, then query execution time is reduced, but compilation overhead is introduced
Solution Approach 1:
The patent applies partial compilation by generating specialized automaton code only when beneficial conditions are met (e.g., repeated regex operations on the same input string or highly selective patterns). The query optimizer evaluates whether the compilation overhead is justified by the expected performance gains, applying the principle of doing just enough optimization to achieve net benefit
4Speed
If hardware acceleration is used for regex operations, then execution speed is improved, but system cost and flexibility are reduced
Solution Approach 1:
The patent implements a dynamic, software-based automaton execution model that adapts to different regex patterns and input strings at runtime. Instead of fixed hardware circuits, the system generates and executes specialized machine code dynamically, providing both speed improvement through optimization and flexibility through programmability
Solution Approach 2:
The patent changes the operational parameters of the regex engine by allowing it to work directly with encoded string tokens instead of decoded characters. The automaton transitions are defined based on token values rather than character values, fundamentally changing how the matching process operates while preserving accuracy
Data Source
AI summary
Techniques are described for generating an encoded-string automaton for a regex pattern from a decoded-string automaton of the regex pattern. In an embodiment, the process obtains a decoded-string automaton of the regex pattern and applies unique decoded string value(s) from the dictionary of the encoding. When applied at a selected state in the decoded-string automaton, the application may yield a transition to at least one target state in the decoded-string automaton for a unique dictionary value. Such a transition generates a transition in the encoded-string automaton from an encoded state corresponding to the selected state in the decoded-string automaton to a target state in the encoded-string automaton corresponding to the target state in the decoded-string automaton. The generated transition in the encoded-string automaton is conditioned on the token of the unique decoded string value in the dictionary.


