pdb.agg allows for
these results to be returned in a single “faceted” query. This can significantly improve read throughput, since issuing a single
query uses less CPU and disk I/O.
For example, this query returns the top 3 search results alongside the total number of results found.
Expected Response
Faceted queries require that
pdb.agg be used as a window function:
pdb.agg() OVER ().Faceted Performance Optimization
On every query, ParadeDB runs checks to ensure that deleted or updated-away rows are not factored into the result set. If your table is not frequently updated or you can tolerate an approximate result, the performance of faceted queries can be improved by disabling these visibility checks. To do so, set the second argument ofpdb.agg to false.