OdyseeTeam / chainquery

Chainquery parses and syncs the LBRY blockchain data into structured SQL
https://lbry.tech
MIT License
2.25k stars 42 forks source link

Prevent Big Queries #90

Open tiger5226 opened 5 years ago

tiger5226 commented 5 years ago

https://dev.mysql.com/doc/refman/5.7/en/optimizer-hints.html#optimizer-hints-execution-time

We can add optimizer hints to our exposed query API that prevents big queries from running on the instance.

We should also consider requiring LIMIT on all queries performed via the public API. Preferably we use a regex to require <query> LIMIT X( OFFSET Y)

Big queries can cause a memory spike on the machine.