-
Notifications
You must be signed in to change notification settings - Fork 227
Closed
Description
requests_monitor = SQLAlchemyConnectionField(
RequestConnection,
request_name=String(),
...
)
def resolve_requests_monitor(self, info, **args):
query = RequestNode.get_query(info)
query = query.join(Request.dataset)
for field, value in args.items():
query = query.filter(getattr(Request, field) == value)
return query
The table I was querying has 10 million records. When I ran the following query, it was super slow. But when I added query.limit(1000), it was way faster. This made me wonder if first and last were not applied by default when querying the db and actually applied afterwards. If not, what's the correct way of using it?
requestsMonitor(first:1000){
edges{
node{
requestId
}
}
}
Metadata
Metadata
Assignees
Labels
No labels