Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slow query when updating a lot of path tokens #316

Open
vnugent opened this issue Jun 14, 2023 · 0 comments
Open

Slow query when updating a lot of path tokens #316

vnugent opened this issue Jun 14, 2023 · 0 comments

Comments

@vnugent
Copy link
Contributor

vnugent commented Jun 14, 2023

When working on PR #314 my laptop CPUs peaked for about 1 minute when updating a large tree.

Steps to reproduce:

  1. Rename a US state
  2. Watch mongo log (docker logs -f <mongo container id>)

While the update will take around 2-3s, I think the change history code causes CPUs to peak and fan running at high speed for about 1 minute.

async record (changeRecord: BaseChangeRecordType): Promise<this> {

mongo complains about Slow query

{"t":{"$date":"2023-06-14T04:55:16.739+00:00"},"s":"I",  "c":"COMMAND",  "id":51803,   "ctx":"conn1744","msg":"Slow query","attr":{"type":"command","ns":"openbeta.$cmd","command":{"update":"change_logs","updates":[{"q":{"_id":{"$oid":"64894824fd36d9b6032697e2"}},"u":{"$setOnInsert":{"createdAt":{"$date":"2023-06-14T04:55:05.320Z"}},"$push":{"changes":{"$each":[{"_id":{"_data":"8264894828000000012B022C01002C01EC6E5A1004A1760F9BEFF84607B0673B9FB1CC630946645F696400646467AA00E622317BDB3C18AE0004"},"dbOp":"update","fullDocument":{"_id":{"$oid":"6467aa00e622317bdb3c18ae"},"area_name":"Átya tpísh (North face)","shortCode":"","climbs":[{"$uuid":"5db94c91-4482-529a-a113-30c2d969a9d6"},{"$uuid":"34f74ebd-3d80-5a5e-b571-532d173526a6"},{"$uuid":"5ecc5de6-c6d9-57c6-870a-348bc80f14ee"},

...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant