AbsaOSS / AbsaOSS/enceladus

Counting runs count takes too much MongoDB CPU

Đang mở
#2,199 1 bình luận 0 reaction 0 người được giao Xem trên GitHub
bug DB priority: high Rest-API
Ngôn ngữ chính
Scala
Star
33
Fork
16
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

## Describe the bug
When application is counting _Runs_ count for the landing page info, it consumer too much CPU.

## To Reproduce
See server logs

## Expected behavior
It might not be necessary to run full scan of the table.

## Log
```
2023-10-27T06:31:47.590+0000 I COMMAND [conn7104853] command menas_galactic.run_v1 command: aggregate { aggregate: "run_v1", pipeline: [ { $match: {} }, { $group: { _id: 1, n: { $sum: 1 } } } ], cursor: {}, $db: "menas_galactic", $clusterTime: { clusterTime: Timestamp(1698388263, 159), signature: { hash: BinData(0, E86133DC3872EAE27881D51B179B0E150F1E874A), keyId: 7256402329547571201 } }, lsid: { id: UUID("5a5b1fa6-3fc7-4f36-9a38-e9ae6c73e7cd") } } planSummary: COLLSCAN keysExamined:0 docsExamined:6077042 cursorExhausted:1 numYields:47554 nreturned:1 reslen:259 locks:{ Global: { acquireCount: { r: 47556 } }, Database: { acquireCount: { r: 47556 } }, Collection: { acquireCount: { r: 47556 } } } storage:{ data: { bytesRead: 15558954293, timeReadingMicros: 17675795 }, timeWaitingMicros: { cache: 2796143 } } protocol:op_msg 42437ms
```

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.