Skip to content

Extra queries to _SCHEMA #896

Closed
Closed
@steven-supersolid

Description

@steven-supersolid

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    type:featureNew feature or improvement of existing feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions