-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Extra queries to _SCHEMA #896
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
Comments
Fixed by #919 |
I've added some trace statements and found this unrelated to the mentioned PR. Please can this be re-opened @drew-gross? Find object:
This seems to be a limitation of the library - the schema needs to be read each time there is a rest request. Save object:
Potentially once the schema has been loaded in RestWrite.validateSchema it could be passed as an optional parameter to DatabaseController.update. |
Sure, we will keep working on this. |
We could definitely keep a cache in memory of the _Schemas |
We've added a schema cache a while ago, closing. Feel free to reopen if the issue persist. |
I've tested running some simple operations using parse.com and using parse-server on Heroku, using the same Parse application and database on mLab. I enabled profiling level 2 and performed the following:
Query on _User
parse.com:
{ "op" : "query", "ns" : "myapp._User", "query" : { "$query" : { "_id" : "1" }...
parse-server:
{ "op" : "query", "ns" : "myapp._SCHEMA", "query" : { }...
{ "op" : "query", "ns" : "myapp._User", "query" : { "$query" : { "_id" : "1" }...
So there is an extra query on _SCHEMA each time.
Save Inventory (custom class)
parse.com:
{ "op" : "command", "ns" : "myapp.$cmd", "command" : { "findAndModify" : "Inventory", "query" : { "_id" : "rtWGOfh6bo" }...
parse-server:
{ "op" : "query", "ns" : "myapp._SCHEMA", "query" : { }...
{ "op" : "query", "ns" : "myapp._SCHEMA", "query" : { }...
{ "op" : "command", "ns" : "myapp.$cmd", "command" : { "findandmodify" : "Inventory", "query" : { "_id" : "i3fwQlIeeB" }...
This is querying _SCHEMA twice for each call.
My use case is to query Inventory, modify and then save so this actually performs a total of 3 _SCHEMA queries. During a previous test I also noticed additional queries to _Role but those were not present in this recent test, possibly due to a change in parse-server. Each query to _Role also incurred an additional query to _SCHEMA so I'll repeat the test.
If some of the additional queries to _SCHEMA could be avoided, particularly the double query on save then it may improve the max request/second. Even better would be to add an option to disable queries on _SCHEMA because my application code already knows what the schema is.
The text was updated successfully, but these errors were encountered: