PostgREST / postgrest

REST API for any Postgres database
https://postgrest.org
MIT License
22.65k stars 1k forks source link

Slow responses with wide rows/columns #2770

Open steve-chavez opened 1 year ago

steve-chavez commented 1 year ago

No repro yet, but putting this here for further investigation.

I had a query that was taking 30 seconds to load via the Python supabase client(uses PostgREST), then I switched to psycopg and it brought it down to 5 seconds. it was just a select all from a table with 151,898 rows and each row has 60 columns.

(From reddit)

I've seen other cases where wide tables(with a good amount of columns) results in slow responses.

For now I believe this could be related to Hasql decoding.


Related: https://github.com/PostgREST/postgrest/discussions/2831

steve-chavez commented 1 year ago

I've seen other cases where wide tables(with a good amount of columns)

This can also happen with tables with few columns but one of them being a json column that contains big values.