Slow Join Filter via Javascript Client (SQL is fast)
Hey there,
I'm creating a new JS Client query to retrieve rows according to a filter on a foreign table via reference. Something like this:
This query times out each time it's run with the error:
When I run this query using a Postgres SQL command, however, it completes in a second.
(I've changed the names of the tables from the originals)
Stats
rooms: 609956
hotels: 159549
Additionally, I've added indexes to both:
I'm creating a new JS Client query to retrieve rows according to a filter on a foreign table via reference. Something like this:
This query times out each time it's run with the error:
When I run this query using a Postgres SQL command, however, it completes in a second.
(I've changed the names of the tables from the originals)
Stats
rooms: 609956
hotels: 159549
Additionally, I've added indexes to both:
- rooms.hotel_id
- hotels.company_id