Skip to main content
This feature is available on versions 0.25.5 and above.
Some filters are best handled by a regular database index instead of by the ParadeDB index. This is common when the filter depends on an extension type or a search method built for a specialized domain. Examples include ltree path filters or PostGIS spatial filters. When a useful external index is available, ParadeDB can use it to narrow the candidate rows before returning search results. Without that external index, ParadeDB still returns correct results, but it checks the specialized filter row by row. As an example, let’s start with the built-in mock_items table and create a larger example table with one specialized location column.
Next, run a query that combines a ParadeDB text search with a geometric filter:
To inspect the plan before adding a separate index on location, run:
Without a separate index on location, ParadeDB finds the text matches first and then checks the location filter row by row. Now add an index on location that can answer this kind of containment filter.
Run the same query again:
The plan should have changed to include a Bitmap Index Scan. This means the location filter is no longer being checked row by row. Over large result sets, this results in a significant reduction in page reads and, consequently, query time improvement.

Limitations

This is an optimization, so ParadeDB will fall back to regular row-by-row filtering when the safer or cheaper path is to avoid the extra index. The most common reasons are:
  • The filter appears under OR or NOT. Only AND is currently supported.
  • More than one external index could help. ParadeDB currently chooses the best single external index instead of combining several.
  • The filter uses SQL’s = ANY (...) array form.
  • The candidate set from the external index is expected to be too large, or the filter is not selective enough to justify the extra work.
If your query still checks the filter row by row, please open a GitHub issue with the query, index definitions, and EXPLAIN output.