You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Drizzle emits call-shaped forms for everything except equality (where it emits bare `=` — tracked in a sibling issue). The call-shaped forms look right — they're function calls, which is the right shape for matching functional indexes — but the function names don't match EQL's documented index extractors. Whether the planner pushes them down depends on operator/function inlinability, which we haven't verified.
For each Drizzle form, does the planner engage the documented functional index, fall back to seq scan, or hit some other path? Possible outcomes:
Inlining wins: `eql_v2.like(col, $1)` is inlined to `eql_v2.bloom_filter(col) @> eql_v2.bloom_filter($1)`, and the planner matches the GIN index. Best case.
Inlining blocked, fallback is correct but slow: `eql_v2.like` is opaque to the planner (e.g. plpgsql with SET search_path — the same constraint that PR fix: pin search_path on every eql_v2 function encrypt-query-language#177 ran into for the GIN containment helpers), so the index never engages and the function evaluates per-row. Functional but seq-scan-shaped.
Worse — index totally absent: there's no `eql_v2.like` functional index recipe documented anywhere, and the underlying bloom filter index isn't engaged by this form even with inlining. Need a different documented index pattern, or a different emitted form.
Without EXPLAIN against the bench fixture, we're guessing.
Reproduction setup
The encrypt-query-language repo has the canonical fixture:
`tests/sqlx/fixtures/bench_setup.sql` — creates `bench_text_bloom_idx` (GIN on `bloom_filter`), `bench_text_hmac_idx` (hash on `hmac_256`), `bench_int_ore_idx` (btree on encrypted_int).
Apply bench fixtures (with and without `drop_operator_classes`).
Construct the query Drizzle would emit by hand.
Run `EXPLAIN (ANALYZE, BUFFERS)` and observe whether the documented functional index is used.
Note inline-blockers (e.g. SET search_path on the called function — verifiable via `SELECT prosrc, proconfig FROM pg_proc WHERE proname = 'like' AND pronamespace = 'eql_v2'::regnamespace`).
Outcome and follow-ups
If form 1 (inlining wins): close as no-action, document.
If form 2 (inlining blocked): file a follow-up either to (a) make the relevant EQL functions inlinable (bare `LANGUAGE SQL` without SET, with schema-qualified bodies — the same shape used in perf: register cross-type btree/hash operators with eql_v2 opfamilies encrypt-query-language#186 for cross-type opfamily support functions), or (b) change Drizzle's emitted form to bypass the indirection.
If form 3 (no index path): much bigger problem; needs a coordinated fix between EQL (define a recipe) and Drizzle (emit the matching form).
Priority
Medium-but-foundational. The findings determine whether Drizzle is fundamentally OK on Supabase (modulo the equality fix in the sibling issue) or whether we need to revise the Drizzle layer more broadly.
Related
(sibling) Drizzle eq/ne/inArray bare-form issue — direct fix, no investigation needed.
(parent) encryptedSupabase critical issue — different root cause (PostgREST limitation) but same Supabase-perf umbrella.
Summary
Drizzle emits call-shaped forms for everything except equality (where it emits bare `=` — tracked in a sibling issue). The call-shaped forms look right — they're function calls, which is the right shape for matching functional indexes — but the function names don't match EQL's documented index extractors. Whether the planner pushes them down depends on operator/function inlinability, which we haven't verified.
What Drizzle emits (with file:line evidence)
What we don't know
For each Drizzle form, does the planner engage the documented functional index, fall back to seq scan, or hit some other path? Possible outcomes:
Without EXPLAIN against the bench fixture, we're guessing.
Reproduction setup
The encrypt-query-language repo has the canonical fixture:
For each Drizzle form:
Outcome and follow-ups
Priority
Medium-but-foundational. The findings determine whether Drizzle is fundamentally OK on Supabase (modulo the equality fix in the sibling issue) or whether we need to revise the Drizzle layer more broadly.
Related