Open annrpom opened 6 months ago
Repro:
demo@127.0.0.1:26257/demoapp/movr> create type t as (foo int, bar int); CREATE TYPE Time: 5ms total (execution 5ms / network 0ms) demo@127.0.0.1:26257/demoapp/movr> select attrelid::regclass, attname, atttypid::regtype, attnum from pg_attribute where -> attrelid = 't'::regclass; attrelid | attname | atttypid | attnum -----------+---------+----------+--------- t | foo | int8 | 1 t | bar | int8 | 2 (2 rows) Time: 15.917s total (execution 15.917s / network 0.000s)
Observe the 15.917s total latency on the introspection query
15.917s total
However, if we lookup t's oid via the pg_type table (cast to regtype instead of regclass), we get what we expect:
t
pg_type
regtype
regclass
demo@127.0.0.1:26257/demoapp/movr> select attrelid::regclass, attname, atttypid::regtype, attnum from pg_attribute where -> attrelid = 't'::regtype; attrelid | attname | atttypid | attnum -----------+---------+----------+--------- t | foo | int8 | 1 t | bar | int8 | 2 (2 rows) Time: 7ms total (execution 6ms / network 0ms)
So it looks like pg_type is good - something in pg_class is likely the problem.
pg_class
While we are here, we can see/keep track of how many round trips the query does by adding this to rttanalysis tests.
rttanalysis
Jira issue: CRDB-37145
@annrpom Did this come from a support escalation? If it did can we add the tags on this issue for that
It did not @fqazi 🙇
Repro:
Observe the
15.917s total
latency on the introspection queryHowever, if we lookup
t
's oid via thepg_type
table (cast toregtype
instead ofregclass
), we get what we expect:So it looks like
pg_type
is good - something inpg_class
is likely the problem.While we are here, we can see/keep track of how many round trips the query does by adding this to
rttanalysis
tests.Jira issue: CRDB-37145