-
Notifications
You must be signed in to change notification settings - Fork 1k
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] Redundant read for create table with primary key #8024
Comments
Stacktrace:
The 'extra' PGSQL_READ RPC request is generated by IndexBuildHeapScan() when building a primary key index. |
build state I think that, for pkey, |
Summary: Compared with creating one table without a pkey, when creating a table with a pkey, we issue a redundant read from a table scan. This revision fixes redundant PGSQL_READ requests when creating tables with a primary key. The test: org.yb.pgsql.TestPgCacheConsistency#testNoDDLRetry is removed because - this test fails as expected due to the change in this revision. - this test will be deleted by [[ https://phabricator.dev.yugabyte.com/D10666 | D10666 ]], so it is better to delete it rather than try to change it. Test Plan: ./yb_build.sh --scb --java-test org.yb.pgsql.TestPgDdl#testCreateTableWithPrimaryKey seekCount and nextCount were different for with and without pkey before code changes. With pkey and without pkey counts become the same after code changes. Reviewers: mihnea, rskannan, jason Reviewed By: jason Subscribers: zyu, jason, yql Differential Revision: https://phabricator.dev.yugabyte.com/D11344
Summary: Compared with creating one table without a pkey, when creating a table with a pkey, we issue a redundant read from a table scan. This revision fixes redundant PGSQL_READ requests when creating tables with a primary key. The test: org.yb.pgsql.TestPgCacheConsistency#testNoDDLRetry is removed because - this test fails as expected due to the change in this revision. - this test will be deleted by [[ https://phabricator.dev.yugabyte.com/D10666 | D10666 ]], so it is better to delete it rather than try to change it. Test Plan: ./yb_build.sh --scb --java-test org.yb.pgsql.TestPgDdl#testCreateTableWithPrimaryKey seekCount and nextCount were different for with and without pkey before code changes. With pkey and without pkey counts become the same after code changes. Reviewers: mihnea, rskannan, jason Reviewed By: jason Subscribers: zyu, jason, yql Differential Revision: https://phabricator.dev.yugabyte.com/D11344
When creating a table with a primary key it looks like we issue a redundant read from the table itself.
This can be noticed by using the debug flag:
and comparing the requests between a table without a pkey and one with a pkey.
For the latter, we see read requests to the main table (e.g. grep the postgresql log by the created table's id).
This may be related to an internal index backfill attempt, but for us we shouldn't need this for a primary key because the table is already primary key organized (so the pkey and main table point to the same data already).
We should confirm if this additional read is indeed not needed and, if so, remove it.
cc @ramsrivatsa @emhna @jaki
The text was updated successfully, but these errors were encountered: