-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
sql: query performance regression in pg_catalog query that resolves database objects and their descriptions #102613
Labels
A-sql-pgcatalog
C-bug
Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.
S-2
Medium-high impact: many users impacted, risks of availability and difficult-to-fix data errors
T-sql-foundations
SQL Foundations Team (formerly SQL Schema + SQL Sessions)
Comments
Adding a |
Here's a simplified reproduction: SELECT relname, d.description
FROM pg_description AS d
INNER JOIN pg_class AS c ON d.objoid = c.oid
WHERE d.objsubid = 0; On v22.2.6 in the demo it takes ~10ms. On master it takes ~4.5s. |
when we fix this, let's be sure to add the repro into pkg/bench/rttanalysis/orm_queries_bench_test.go |
fqazi
added a commit
to fqazi/cockroach
that referenced
this issue
May 10, 2023
Previously, we refactored the code to fetch comments, descriptors, and zone config together in all cases. A side effect of this change was that the crdb_internal.kv_system_comments table was substantially slower for larger tables leading to big regressions. To address this, this patch adds a method of only fetching comments within the collections. Informs: cockroachdb#102851 Fixes: cockroachdb#102613 Release note (bug fix): Optimize over-head of pg_catalog.pg_description and pg_catalog.pg_shdescription, which can lead to performance regression relative to 22.2
fqazi
added a commit
to fqazi/cockroach
that referenced
this issue
May 10, 2023
Previously, we refactored the code to fetch comments, descriptors, and zone config together in all cases. A side effect of this change was that the crdb_internal.kv_system_comments table was substantially slower for larger tables leading to big regressions. To address this, this patch adds a method of only fetching comments within the collections. Informs: cockroachdb#102851 Fixes: cockroachdb#102613 Release note (bug fix): Optimize over-head of pg_catalog.pg_description and pg_catalog.pg_shdescription, which can lead to performance regression relative to 22.2
fqazi
added a commit
to fqazi/cockroach
that referenced
this issue
May 11, 2023
Previously, we refactored the code to fetch comments, descriptors, and zone config together in all cases. A side effect of this change was that the crdb_internal.kv_system_comments table was substantially slower for larger tables leading to big regressions. To address this, this patch adds a method of only fetching comments within the collections. Informs: cockroachdb#102851 Fixes: cockroachdb#102613 Release note (bug fix): Optimize over-head of pg_catalog.pg_description and pg_catalog.pg_shdescription, which can lead to performance regression relative to 22.2
fqazi
added a commit
to fqazi/cockroach
that referenced
this issue
May 11, 2023
Previously, we refactored the code to fetch comments, descriptors, and zone config together in all cases. A side effect of this change was that the crdb_internal.kv_system_comments table was substantially slower for larger tables leading to big regressions. To address this, this patch adds a method of only fetching comments within the collections. Informs: cockroachdb#102851 Fixes: cockroachdb#102613 Release note (bug fix): Optimize over-head of pg_catalog.pg_description and pg_catalog.pg_shdescription, which can lead to performance regression relative to 22.2
craig bot
pushed a commit
that referenced
this issue
May 13, 2023
103106: sql/catalog: avoid fetching descriptors when fetching comments r=fqazi a=fqazi Previously, we refactored the code to fetch comments, descriptors, and zone config together in all cases. A side effect of this change was that the crdb_internal.kv_system_comments table was substantially slower for larger tables leading to big regressions. To address this, this patch adds a method of only fetching comments within the collections. Additionally, we added many builtins into both functions, which meant our existing virtual index look-up could end up falling back too frequently to full scans. Also, a virtual index is added on the kv_catalog_comments table for fast point look-ups when referencing descriptors. Informs: #102851 Fixes: #102613 Release note (bug fix): Optimize over-head of pg_catalog.pg_description and pg_catalog.pg_shdescription, which can lead to performance regression relative to 22.2 Co-authored-by: Faizan Qazi <[email protected]>
blathers-crl bot
pushed a commit
that referenced
this issue
May 15, 2023
Previously, we refactored the code to fetch comments, descriptors, and zone config together in all cases. A side effect of this change was that the crdb_internal.kv_system_comments table was substantially slower for larger tables leading to big regressions. To address this, this patch adds a method of only fetching comments within the collections. Informs: #102851 Fixes: #102613 Release note (bug fix): Optimize over-head of pg_catalog.pg_description and pg_catalog.pg_shdescription, which can lead to performance regression relative to 22.2
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-sql-pgcatalog
C-bug
Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.
S-2
Medium-high impact: many users impacted, risks of availability and difficult-to-fix data errors
T-sql-foundations
SQL Foundations Team (formerly SQL Schema + SQL Sessions)
This query is really slow and seems to be a regression in 23.1 compared to 22.2.8:
Explain:
The slow part
However on 22.2.8 this is much faster
Statement Bundle
Commit used to build cockroach: f8523ec
Jira issue: CRDB-27560
The text was updated successfully, but these errors were encountered: