I am trying to switch over from REST to GraphQL, and am experiencing horribly slow responses for queries. As in 5000-7000+ ms for a super simple, small request. I’ve spent days on this, tried everything, and am about to give up. Any help would be greatly appreciated.
I have greatly reduced the schema from the huge one auto-generated to a tiny one for testing (no difference), implemented filters (no difference), simplified the query to only return a few, have indexed the main field (helped a tiny bit), and have not resolvers or anything special at all.
I am on the M10 tier.
The schema:
{
"title": "mlbgame",
"properties": {
"_id": {
"bsonType": "string"
},
"_simulation": {
"bsonType": "bool"
},
"date": {
"bsonType": "string"
},
"endDate": {
"bsonType": "date"
},
"gameInfo": {
"bsonType": "string"
},
"gameStatus": {
"bsonType": "string"
},
"id": {
"bsonType": "string"
},
"minutesRemaining": {
"bsonType": "int"
},
"percentComplete": {
"bsonType": "double"
},
"sport": {
"bsonType": "string"
},
"startDate": {
"bsonType": "date"
},
"status": {
"bsonType": "string"
}
}
}
The query:
query GamesForCalendar($dateFrom: DateTime!, $dateTo: DateTime!) {
mlbgames(query: {startDate_gte: $dateFrom, startDate_lte: $dateTo}) {
id
status
sport
date
startDate
endDate
gameInfo
gameStatus
minutesRemaining
percentComplete
_simulation
}
}
A sample log entry:
Function Call Location: US-OR GraphQL Query:
query GamesForCalendar($dateFrom: DateTime!, $dateTo: DateTime!) { mlbgames(query: {startDate_gte: $dateFrom, startDate_lte: $dateTo}) { id status sport date startDate endDate gameInfo gameStatus minutesRemaining percentComplete _simulation __typename } }
Compute Used:
18736722090 bytes•ms
Remote IP Address:
136.32.230.69
Rule Performance Metrics:
{
"dfsdb.mlbgames": {
"roles": {
"default": {
"matching_documents": 19,
"evaluated_fields": 0,
"discarded_fields": 0
}
},
"no_matching_role": 0
}
}
I have an index on startDate as well. The result set is only 6k. Please help! Surely I am missing something, or there is some explanation, as this is completely unusable.
Best,
Greg