hackoregon / transportation-backend

Transportation backend repo - 2016 and 2017
8 stars 7 forks source link

Slow API queries #25

Open sanjuroj opened 7 years ago

sanjuroj commented 7 years ago

The API query is pretty slow to load. I first noticed this when I modified the API to include the source name rather than the id. I suspect the DB is now having to do a join, and that this is taking a while.

znmeb commented 7 years ago

Can you see the SQL it's doing somehow? Then you could go into PgAdmin and do an 'explain' on the query.

sanjuroj commented 7 years ago

I've never had to do this, so I don't have a clue off the top of my head. That sounds like a reasonable suggestion though.

znmeb commented 7 years ago

Somebody who knows Django internals should be able to figure it out.