Description
Environment
- PostgreSQL version: 15.2
- PostgREST version: 10.2
- Operating system: Ubuntu 20.04, WSL
Description of issue
Sending a HEAD
request actually executes the query and sends the aggregated JSON query results back to PostgREST, even though the response will just be discarded. I think PostgREST should just compute the count
and send that back alone, to avoid unnecessary CPU and I/O operations for something which is just discarded.
I ran into this whilst using a HEAD
request with Prefer: count=exact
. Adding an explicit limit=0
to avoid actually sending any data decreased the response timing by nearly half.