Our the monitoring in couchbase (servers -> statistics -> n1ql queries/sec) shows constantly running n1ql queries at a rate of 6 queries/sec.
Query monitoring does not show any queries. We cannot attribute these queries to anything as all our services are down. Are these internal operations or are we missing something?
Is there anyway to debug/investigate which queries are running on the system?
that returns “select * from system:active_requests;” as the only running query
ns_server might running queries to collect statistics at constant interval.
If really want to know you can set completed-threshold:0 and look at system:completed_requests after few secs.
NOTE: Try reset value after your test otherwise memory usage can grow.
so from that I see queries looking like this:
“statement”: “select max(keyspace_id) id, max(has_primary) has_prim, max(has_second) has_sec, max(secondary_indexes) sec_ind from ( select indexes.keyspace_id, true has_primary from system:indexes where is_primary = true and state = ‘online’ union select indexes.keyspace_id, true has_second, array_agg(indexes.index_key) secondary_indexes from system:indexes where state = ‘online’ and is_primary is missing or is_primary = false group by keyspace_id having keyspace_id is not null union select id keyspace_id from system:keyspaces except (select indexes.keyspace_id from system:indexes where state = ‘online’ union select “” keyspace_id) ) foo group by keyspace_id having keyspace_id is not null order by keyspace_id”,
“userAgent”: “Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:62.0) Gecko/20100101 Firefox/62.0 (Couchbase Query Workbench (5.0.1-5003-enterprise))”,
"state": "completed", "statement": "infer `cms_schema`;", "userAgent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:62.0) Gecko/20100101 Firefox/62.0 (Couchbase Query Workbench (5.0.1-5003-enterprise))", "users": "admin"
Are these normal internal queries?
Figured out it was the workbench UI. Thanks for all your help!