Page MenuHomePhabricator

[services] Tunnelbroker - Change `findMessageItem`, `removeMessageItem` to use composite key
ClosedPublic

Authored by max on Aug 1 2022, 6:58 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Dec 19, 10:22 PM
Unknown Object (File)
Thu, Dec 19, 10:22 PM
Unknown Object (File)
Thu, Dec 19, 10:20 PM
Unknown Object (File)
Mon, Dec 16, 6:28 PM
Unknown Object (File)
Mon, Dec 16, 6:27 PM
Unknown Object (File)
Mon, Dec 16, 12:51 AM
Unknown Object (File)
Mon, Dec 16, 12:51 AM
Unknown Object (File)
Tue, Dec 10, 7:27 PM

Details

Summary

As we changed the messages table model to use a composite key in ENG-1362 we can use a composite key instead of an index in findMessageItem, removeMessageItem methods to improve database lookup performance.

Linear task: ENG-1493

Test Plan

Run database-related unit tests using yarn run-unit-tests

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

max held this revision as a draft.
max published this revision for review.Aug 1 2022, 7:02 AM
max edited the summary of this revision. (Show Details)

Run database-related unit tests using yarn run-unit-tests

If we're relying on the tests, we need to make sure that they are really helpful. If the tests were passing before this change and after it, are we really sure that our change changes anything? The solution to that issue is to introduce a test which would be failing with the older code but is now passing - do you think it is possible to have such a test?

This revision is now accepted and ready to land.Aug 2 2022, 7:25 AM
In D4694#135372, @tomek wrote:

Run database-related unit tests using yarn run-unit-tests

If we're relying on the tests, we need to make sure that they are really helpful. If the tests were passing before this change and after it, are we really sure that our change changes anything? The solution to that issue is to introduce a test which would be failing with the older code but is now passing - do you think it is possible to have such a test?

Thanks for a comment @tomek ! The test is passing because the test file is changed too due to the function changes. I don't think we need another test that fails if using old methods instead because the updated tests will fail.

In D4694#135499, @max wrote:
In D4694#135372, @tomek wrote:

Run database-related unit tests using yarn run-unit-tests

If we're relying on the tests, we need to make sure that they are really helpful. If the tests were passing before this change and after it, are we really sure that our change changes anything? The solution to that issue is to introduce a test which would be failing with the older code but is now passing - do you think it is possible to have such a test?

Thanks for a comment @tomek ! The test is passing because the test file is changed too due to the function changes. I don't think we need another test that fails if using old methods instead because the updated tests will fail.

You're right! Sorry for the confusion!