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

As a Metric user I want corrector queries to use DB indexes #46

Open
VitaliStupin opened this issue Apr 5, 2023 · 1 comment
Open

Comments

@VitaliStupin
Copy link
Contributor

Currently query executed by get_faulty_raw_documents() is slow because it does not use indexes:
https://github.com/nordic-institute/X-Road-Metrics/blob/develop/corrector_module/opmon_corrector/database_manager.py#L110-L118

It can be solved for new installations by adding new index to raw_messages in xroad-metrics-init-mongo:
https://github.com/nordic-institute/X-Road-Metrics/blob/develop/collector_module/opmon_mongodb_maintenance/create_indexes.py#L32

[('corrected', ASC), ('xRequestId', ASC)]

Or by running indexing command manually:

db.raw_messages.createIndex({"corrected": 1, "xRequestId": 1})

Additional notes: If would be great to mention the need to create new indexes in release notes.

@raits
Copy link
Contributor

raits commented Apr 10, 2023

Hello,

Thank you for the report. We will look into it.

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

No branches or pull requests

2 participants