-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Too many SELECT queries on startup #2
Comments
Hey @cope, this occurred because waterline checks all mapping's models in the database.. If you're using setting migrate:'safe' and had mapped a model that doesn't exist's in your database a error is going to occur otherwise if you're using migrate:'alter' and mapped structure that doesn't exist in the database it's going to be created. About prevent it from happening I can check this, initially I think that is possible and I can make it configurable like logQueries option. I have plans to refactor this lib to get better performance in queries that use complex joins in next months and your suggestion will be included in my task list 😄 But if you want to contribute, all help and suggestions will be appreciated. Regards. |
Hey @lucianmachado, awesome, thanks! I'm using migrate:'safe'. If you give me a hint where to look, I can certainly try to contribute. On a side note, we found an issue with case-insensitive filtering, so I created a pull request to waterline-sequel, would love to hear what your oppinion on that fix is: balderdashy/waterline-sequel#105 |
Hey @cope, I'm back with good news. I had updated this adatper and a lot of fixes and optimizations were made, including your sugestion. But for curiosity purpose, this is the function who execute all that queries. About your fix, unfortunately it don't fix on this adapter but I did a workaround to fix this bug in this adapter. Case insensitive filtering was known bug since I forked this adapter. If you update the module in your project you'll realize these things: In our last contact you asked me about a hint, I think for better understanding you can see this example of a adapter: I wish refactor this since I forked but my focus is to make it stable, so if you find an another bug feel free to send a pull request or open an issue. All help always will be apreciate. Best regards! |
Hey @lucianmachado, After uninstalling and reinstalling the package, I can confirm that the startup time is now perfect! Thanks! |
We recently switched from sails-oracle-db to sails-oracle-database and that one switch caused our startup time to go from 7s to 93s.
Upon setting
logQueries: true
, we see a huge amount of SELECT queries being executed on startup.Is this neccessary and is there any way to prevent it from happening?
Initially I thought it was the migrate:'alter' problem, but even after setting migrate:'safe', the same thing still happens.
The text was updated successfully, but these errors were encountered: