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

[YSQL] Cache FK checks #3328

Closed
ndeodhar opened this issue Jan 13, 2020 · 0 comments
Closed

[YSQL] Cache FK checks #3328

ndeodhar opened this issue Jan 13, 2020 · 0 comments
Assignees
Labels
area/ysql Yugabyte SQL (YSQL)
Milestone

Comments

@ndeodhar
Copy link
Contributor

To improve performance for foreign key checks, we can cache successful FK checks in PgSession. This will help us avoid tserver RPCs if the same key needs to be checked repeatedly in a transaction.

This is especially handy for bulk loading of data where rows in child (FK) tables with the same foreign key are typically loaded together.

@ndeodhar ndeodhar added the area/ysql Yugabyte SQL (YSQL) label Jan 13, 2020
@ndeodhar ndeodhar added this to the v2.1 milestone Jan 13, 2020
@ndeodhar ndeodhar self-assigned this Jan 13, 2020
ndeodhar added a commit that referenced this issue Feb 7, 2020
Summary:
To improve performance for foreign key checks, we can cache successful FK checks in PgSession. This will help us avoid tserver RPCs if the same key needs to be checked repeatedly in a transaction.

This is especially handy for bulk loading of data where rows in child (FK) tables with the same foreign key are typically loaded together.

Performance numbers on TPCC data loading (for 2 warehouses):
Without FK cache: 17.5 mins
With FK cache: 8.5 mins (2x improvement)

Test Plan:
Jenkins
Added Java tests

Reviewers: neil, dmitry, mihnea, alex

Reviewed By: mihnea, alex

Subscribers: kannan, yql

Differential Revision: https://phabricator.dev.yugabyte.com/D7847
@ndeodhar ndeodhar closed this as completed Feb 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/ysql Yugabyte SQL (YSQL)
Projects
None yet
Development

No branches or pull requests

1 participant