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
Agents querying pond_sql_query need to find arbitrary substrings (error messages, identifiers like toolu_01X..., shell commands, file paths) inside tool-call/tool-result bodies, which live in parts.variant_data (binary JSONB). No search surface covers them: pond_search and fts() index only conversational messages.search_text. The fallback is a JSON-stringify + LIKE '%...%' full scan against the query timeout (measured: repeated >30s timeouts).
Measured decision (full data in the comment below)
Benchmarked FM-Index vs ngram vs FTS on the full real corpus (Lance 8.0.0, benches/fmindex_probe.rs). The original "FM-Index directly on variant_data" plan is refuted; ngram on a narrow materialized Utf8 column is the fit.
FM directly on variant_data is not queryable as planned:contains(variant_data, 'x') won't plan (variant_data is LargeBinary; DataFusion contains needs String), and ngram won't build on a binary column - a Utf8 column is mandatory (the earlier "no extracted column, no schema change" assumption was wrong).
FM is too heavy: 2.66 GB on-disk (~0.94x of raw), ~3 GB resident + ~9 s per query (whole-index heap prewarm on every load), vs ngram 480 MiB / ~0.6 GB / 0.2-0.4 s for identical exact results.
FTS doesn't fit: token/word search, not substring (127k false hits for a phrase; 0 for a mid-token needle), and not smaller than ngram on tool-body text.
Build an ngram scalar index on it; expose contains(<col>, 'needle') in pond_sql_query (index-accelerated, exact after verify; case-insensitive / ASCII-folded).
Document it in the tool description + schema://pond-sql; repoint the src/sql.rs timeout / parts-scan TODOs (which still reference this issue) at the new operator.
Interim
Until this lands, src/sql.rs carries TODOs referencing this issue at the timeout hint and the parts-scan guidance, so the gap and the plan stay discoverable.
Why
Agents querying
pond_sql_queryneed to find arbitrary substrings (error messages, identifiers liketoolu_01X..., shell commands, file paths) inside tool-call/tool-result bodies, which live inparts.variant_data(binary JSONB). No search surface covers them:pond_searchandfts()index only conversationalmessages.search_text. The fallback is a JSON-stringify +LIKE '%...%'full scan against the query timeout (measured: repeated >30s timeouts).Status
tool_name/call_id/is_failurematerialized as indexed columns; "which tool / call-id / failed" queries hit narrow indexes (remote tool GROUP BY: >30s -> ~9s). Query timeout is now tunable (timeout_secondsonpond_sql_query,--timeoutonpond sql, max 600s).Measured decision (full data in the comment below)
Benchmarked FM-Index vs ngram vs FTS on the full real corpus (Lance 8.0.0,
benches/fmindex_probe.rs). The original "FM-Index directly onvariant_data" plan is refuted; ngram on a narrow materialized Utf8 column is the fit.variant_datais not queryable as planned:contains(variant_data, 'x')won't plan (variant_dataisLargeBinary; DataFusioncontainsneedsString), and ngram won't build on a binary column - a Utf8 column is mandatory (the earlier "no extracted column, no schema change" assumption was wrong).Plan
contains(<col>, 'needle')inpond_sql_query(index-accelerated, exact after verify; case-insensitive / ASCII-folded).schema://pond-sql; repoint thesrc/sql.rstimeout / parts-scan TODOs (which still reference this issue) at the new operator.Interim
Until this lands,
src/sql.rscarries TODOs referencing this issue at the timeout hint and the parts-scan guidance, so the gap and the plan stay discoverable.