Skip to content

perf(fsst): push down '%suffix' LIKE without decompression - #9728

Open
jackylee-ch wants to merge 1 commit into
vortex-data:developfrom
jackylee-ch:fsst-suffix-pushdown
Open

perf(fsst): push down '%suffix' LIKE without decompression#9728
jackylee-ch wants to merge 1 commit into
vortex-data:developfrom
jackylee-ch:fsst-suffix-pushdown

Conversation

@jackylee-ch

Copy link
Copy Markdown
Contributor

LikeKind::parse handled prefix% and %needle% but not %suffix, so those patterns fell through
FsstMatcher::try_new and the kernel decompressed the whole column. vortex-duckdb already lowers
suffix(col, 'x') to LIKE %x, so on one column prefix() and contains() match on the code
stream while suffix() does not.

Takes the Forward DFA route from the module TODO: the KMP table contains uses, but with a non-sticky
accept state.

Tests

cargo test -p vortex-fsst goes 91 → 106. Two assertions that pinned the old gap are replaced.
Correctness cases alone would pass via the fallback, so test_like_kernel_pushes_down_suffix asserts
the kernel returns Some; unhooking parse_suffix fails 4 tests including that one.

AI assistance

Written with agentic AI assistance; I derived the non-sticky accept states by hand and checked the
mutation fails.

LikeKind::parse handled prefix% and %needle% but not %suffix, so those
patterns fell through FsstMatcher::try_new and the kernel decompressed the
whole column. vortex-duckdb already lowers suffix(col, 'x') to LIKE '%x',
so on the same column prefix() and contains() match on the compressed code
stream while suffix() does not.

Adds FlatSuffixDfa, taking the Forward DFA route the module TODO sketched:
the KMP table contains uses, but with a non-sticky accept state, so the walk
continues past a match and the result is whether the final state is accept.
build_symbol_transitions could not be reused because it short-circuits once
a symbol's bytes reach accept.

Signed-off-by: jackylee <qcsd2011@gmail.com>
@joseph-isaacs

Copy link
Copy Markdown
Contributor

Do you have any benchmarks using real world or synthetic data?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants