Why Supabase Returns a Maximum of 1,000 Rows
Problem: the query to the Supabase (PostgREST) returns only to 1000 records, even when there are more records in the database. This is not a single reason: the limitation may result from PostgREST server settings, proxy configuration, default supabase-js client behavior, or the use of Range/Preference headers (e.g. max-rows). In practice, you need to check the source of the limitation step by step — from SQL and LIMIT queries, through the HTTP headers used by the library, to the Supabase/Edge instance setting. The following procedure gives a specific list of tests to perform, diagnostic variants (if LIMIT in the query, if PostgREST, if proxies) and proven corrective steps, including the use of key-by-key pagination, cursors or change server settings whenever possible.
How to Recognize Cause
Client: check that the code has not been set explicitly .limit(1000) or the default limit. The Supabase-js library allows you to connect .select() to .limit(); check the source query code and network logs in the browser/CLI if the LIMIT parameter is not included.
PostgREST/server: PostgREST can use performance limits based on server configuration (e.g. max-rows) or API Gateway proxy can cut answers. If the query directly to PostgREST (e.g. curl) also returns 1000 records, then the limit is on the server/configuration side.
Step by step solution
1. Query replication by curl: download REST endpoint URL (from dashboard or logs), perform curl -i 'https://.../rest/v1/tablename?select=*' with the same Authorization headers; if the answer has 1000 records, then server-side limitation.
2 . Check customer code: browse places with .select(), .range() and .limit() in the repository. Search for the phrase ".limit(" ".range(" "Preference:", make sure it does not interfere with helper pagination. Remove or modify and compare results.
3 . Range/Preference header test: send a curl request with and without the Prefer header: count=exact; then add Preference: params=single-object; compare — PostgREST changes behavior with specific preferences.
4 . Check server logs/API Gateway: if you have access to the Supabase dashboard or proxy layers, check request logs and possible response limits, timeouts or 413/206 multi-part statuses that may suggest cutting answers.
5 . Alternative key pagination: if the database is large, implement indexed column pagination (WHERE id > last id LIMIT 1000); this bypasses the global limit and gives some repetitive parts of the results.
6 . Test directly on DB (psql): if you have permissions, run SELECT COUNT(*) and SELECT * LIMIT 1500; if psql returns >1000, a problem in the HTTP/PostgREST layer, not in the database.
7 . Verify version and documentation: confirm PostgREST/Supabase version in the instance used and compare with documentation on default limits — if the limit results from the host instance configuration, report to support or apply pagination.
How to see if the problem is gone
Test A — curl without modification: call endpoint REST with the same headers as the application; compare the number of records with SELECT COUNT(*) with psql. The difference indicates a layer cutting off the response.
Test B — key-by-key pagination: complete the WHE id series of queries > last id LIMIT 500 to run out; if collected records equal to number in COUNT, the solution works and bypasses the limit of 1000.
Test C — remove headers/limits in the client: modify the test code so that it does not use .limit/.range/.Pfer; if the response increases above 1000 at a direct curl, the client was the cause.
What to do
Do not assume that the limit of 1000 is an application error – first compare it with the direct SELECT in DB; moving immediately to changes in the code without curl/psql tests will cause unnecessary changes.
Do not increase LIMIT indefinitely in one production request; large one-time answers can cause timeouts and memory problems on the client/server side.
Do not skip server/API Gateway logs: the lack of their analysis is a common error, because that's where you usually see whether the answer has been cut, changed or pagmed by proxy.