⚡ Improvements
- Added
re2_version(), which returns the full semantic version. This is the same value visible inpg_get_loaded_modules(), but available in Postgres versions prior to 18, and without having to load re2 first. - Added Index support, avoiding table scans for patterns that can use an index:
- A pattern starting with
^and a fixed prefix, such asWHERE re2match(col, '^order_2025'), now reads the matching range of an existing b-tree index. See Index Support. - Added
@~match operator (same asre2match) andgin_re2_opsoperator class.CREATE INDEX ... USING gin (col gin_re2_ops)letsWHERE col @~ patternonly visit rows containing required trigrams. - Row-count estimates for
re2matchand@~now come from testing patterns against column statistics for patterns containing a constant pattern. In such cases this improves cost estimation over the default fixed guess, allowing the planner to pick better plans.
- A pattern starting with
📔 Notes
- Run
ALTER EXTENSION re2 UPDATE TO '0.4'to expose the new operator and operator class on existing databases.
🆚 For more detail compare changes since v0.3.0.