Open wolfgangwalther opened 4 months ago
It seems like the LIMIT is already applied inside pgrst_source_count
for regular requests. In my case I am requesting from an RPC, and it seems db-max-rows
is not applied at all.
It seems like the LIMIT is already applied inside
pgrst_source_count
for regular requests.
Thus, it would then be more like "apply a LEAST(1000, db-max-rows)" limit inside the count CTE.
Something like Prefer: count=estimated(1000),
Alternatively, just a new config option db-max-count
, which defaults to db-max-rows
, but allows us to set the max count limit without enforcing a max-rows limit in general.
Perhaps db-max-count
could solve https://github.com/PostgREST/postgrest/issues/3576 too.
Currently to use
count=estimated
we'll need to usedb-max-rows
. Butdb-max-rows
applies to all requests, which is pointless.I want to be able to:
count=estimated
for a much lower limit, when I paginate through the resultset.Maybe we can introduce an option to pass the "estimation limit" to the prefer header directly?
Something like
Prefer: count=estimated(1000)
, which would apply theLIMIT 1000
only inside thepgrst_source_count
CTE: