-
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
*: regression on query duration against system tables #88891
Comments
It looks like the 22.1 apply-join produces 2642 rows, while the 21.1 apply-join produces 1521. Apart from that, I think we may be performing more logging for apply-joins in 22.1 than 21.1. @yuzefovich any thoughts? The plans look about the same. |
Hm, my guess is that with every release we just have more things in different
It seems likely that (assuming there no correctness bugs) this increase in latency is expected because of this. |
Coming back to this originally query, it seems that the apply join is doing something not quite right. I added some logging inside of SELECT jsonb_build_object(
'oid',
"table".oid::INT8,
'columns',
COALESCE(columns.info, '[]')
)::JSONB AS info
FROM pg_catalog.pg_class AS "table"
JOIN pg_catalog.pg_namespace AS schema ON schema.oid = "table".relnamespace
LEFT JOIN pg_catalog.pg_description AS description ON description.classoid
= 'pg_catalog.pg_class'::REGCLASS
AND description.objoid
= "table".oid
AND description.objsubid = 0
LEFT JOIN LATERAL (
SELECT "table".oid AS oid,
jsonb_agg(
jsonb_build_object(
'description',
pg_catalog.col_description("table".oid, "column".attnum)
)
) AS info
FROM pg_catalog.pg_attribute AS "column"
LEFT JOIN pg_catalog.pg_type AS type ON type.oid = "column".atttypid
LEFT JOIN pg_catalog.pg_type AS base_type ON type.typtype = 'd'
AND base_type.oid
= type.typbasetype
WHERE "column".attrelid = "table".oid
AND "column".attnum > 0
AND NOT "column".attisdropped
) AS columns ON columns.oid = "table".oid
WHERE "table".relkind IN ('r',); |
This is now taking ~2 seconds on an empty single node cluster. I will add a micro-benchmark for this, and close this. |
Related: ticket(internal link) and #72407
To Reproduce
This query finishes instantly on Postgres14 but takes a long time (~8mins) in single-node CRDB.
Also, I ran this query against on v22.2.0-beta-1, v22.1.7 and v21.1.21 single-node CRDB, and found a regression in the query duration.
stmt bundles are:
Expected behavior
Regression should not happen, and the query should not take that long.
Jira issue: CRDB-20025
The text was updated successfully, but these errors were encountered: