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
F3301019: D4694.diff
Sun, Nov 17, 11:21 PM
Unknown Object (File)
Sat, Nov 2, 5:30 PM
Unknown Object (File)
Sat, Nov 2, 5:30 PM
Unknown Object (File)
Sat, Nov 2, 5:30 PM
Unknown Object (File)
Sat, Nov 2, 5:29 PM
Unknown Object (File)
Oct 7 2024, 3:24 PM
Unknown Object (File)
Sep 27 2024, 9:05 AM
Unknown Object (File)
Sep 26 2024, 3:29 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
Branch
change-findMessageItem-removeMessageItem-to-composite-key
Lint
No Lint Coverage
Unit
No Test Coverage

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!