Select completed_requests is taking hell lot of time unable to get the results from this dataset

we are getting time out for bellow queries
how do we get only today executed queries without timeout for this system dataset

SELECT requestId ,
clientContextID,
remoteAddr,
elapsedTime ,
node ,
users ,
requestTime ,
resultCount ,
resultSize ,
mutations,
state ,
statement,
userAgent
FROM system:completed_requests AS cr
WHERE users=“monitoring” and requestTime > DATE_ADD_STR(NOW_STR(), ‘day’, -1) limit 10;

SELECT requestId ,
clientContextID,
remoteAddr,
elapsedTime ,
node ,
users ,
requestTime ,
resultCount ,
resultSize ,
mutations,
state ,
statement,
userAgent
FROM system:completed_requests AS cr
WHERE users=“monitoring” ;

A query against system:completed_requests needs to fetch the completed_requests entries from all query nodes in the cluster, and then perform further processing on all these entries on the query node executing the query.

If there are a large number of completed_requests entries across nodes, the query can take a longer amount of time.

  1. Try increasing ( or disabling ) the timeout only for this particular query request - Settings and Parameters | Couchbase Docs

  2. If you are in a multi-node set up and only require entries from particular nodes, you can add a predicate on the “node” field. This can make the query faster.

    Example:
    select * from system:completed_requests where node = "node_name";

1 Like

Also get specific node only requests Query Admin REST API | Couchbase Docs

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.