datagovuk / apiserver

Prototype "NII Data->API" Service
15 stars 3 forks source link

Query "too long to run" when an offset is added. #79

Open Llamatic opened 7 years ago

Llamatic commented 7 years ago

Even know I set a limit of 4999 it still says "Query would take too long to run, please apply a LIMIT of less than 5000 rows"

This is the SQL query I did on the Health SQL page: SELECT * FROM social_care_locations OFFSET 14996 LIMIT 4999

It seems that if an OFFSET is above a certain number it would show the "Query would take too long to run" error.

rossjones commented 7 years ago

Yeah, it's not a perfect solution, there's also the 5s timeout which is probably catching you in this case. As it was built as a proof of concept, I doubt very much this'll get fixed though.

If you're just trying to grab the entire dataset, perhaps it would be easier to just download the source file from https://data.gov.uk/dataset/social-care-locations ?