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

Changed executeUpdate to executeLargeUpdate #1595

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

RibeiroAna
Copy link

@RibeiroAna RibeiroAna commented Apr 30, 2024

At Meta, @stevenwarejones realized that changing executeUpdate to executeLargeUpdate for the ACDPCharges would hugely improve the performance of the PBM.

@uakyol and @SanjayVas if you could take a look (for some reason I cannot officially assign you)

@wfa-reviewable
Copy link

This change is Reviewable

Copy link
Collaborator

@stevenwarejones stevenwarejones left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you add Ugur and @SanjayVas to this?

Reviewed all commit messages.
Reviewable status: 0 of 1 files reviewed, 1 unresolved discussion (waiting on @RibeiroAna)


src/main/kotlin/org/wfanet/measurement/eventdataprovider/privacybudgetmanagement/deploy/common/postgres/PostgresBackingStore.kt line 180 at r1 (raw file):

      statement.setString(2, privacyReference.referenceId)
      statement.setObject(3, privacyReference.isRefund)
      // TODO(@duliomatos) Make the blocking IO run within a dispatcher using coroutines

this TODO still is need, right?

Copy link
Author

@RibeiroAna RibeiroAna left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 1 of 1 files at r2, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @stevenwarejones)


src/main/kotlin/org/wfanet/measurement/eventdataprovider/privacybudgetmanagement/deploy/common/postgres/PostgresBackingStore.kt line 180 at r1 (raw file):

Previously, stevenwarejones (Steven Ware Jones) wrote…

this TODO still is need, right?

Done.

Copy link
Collaborator

@stevenwarejones stevenwarejones left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 1 of 1 files at r2, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @SanjayVas and @uakyol)

Copy link
Member

@SanjayVas SanjayVas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 1 of 1 files at r2, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @RibeiroAna and @uakyol)


src/main/kotlin/org/wfanet/measurement/eventdataprovider/privacybudgetmanagement/deploy/common/postgres/PostgresBackingStore.kt line 180 at r2 (raw file):

      statement.setString(2, privacyReference.referenceId)
      statement.setObject(3, privacyReference.isRefund)
      // TODO: Make the blocking IO run within a dispatcher using coroutines

nit: this TODO is obsolete. Instead of ensuring blocking calls use the appropriate coroutine dispatcher, we should instead be using the asynchronous R2DBC-based Postgres client (org.wfanet.measurement.common.db.r2dbc.postgres.PostgresDatabaseClient). This can have my username as the reference.


src/main/kotlin/org/wfanet/measurement/eventdataprovider/privacybudgetmanagement/deploy/common/postgres/PostgresBackingStore.kt line 181 at r2 (raw file):

      statement.setObject(3, privacyReference.isRefund)
      // TODO: Make the blocking IO run within a dispatcher using coroutines
      statement.executeLargeUpdate()

Can you share more info on the performance difference, e.g. referencing some documentation in a comment that indicates why this would be more performant? The docs for this interface only mention using executeLargeUpdate instead of executeUpdate when there could be more than Int.MAX_VALUE results (the signature difference is that this returns a Long instead of an Int).

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

Successfully merging this pull request may close these issues.

None yet

4 participants