You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I simplify the query as below, the problem doesn't persist (or the difference in reported latency and real latency is too small for me to notice).
SELECT * FROM pg_type AS t WHERE
t.typtype IN ('r', 'e', 'd')
OR t.typinput = 'array_in(cstring,oid,integer)'::REGPROCEDURE
OR t.typelem != 0;
@jordanlewis discovered that the problem is caused by (1) the default CLI prompt requires a few round-trips to display and (2) the number of newlines in the query seem to amplify the number of round-trips.
This is proven by either (A) overriding the default prompt or by (B) removing all new lines from the query.
A. Override the default prompt and re-run the query. The latency reported appears accurate.
\set prompt1=>
B. With the default prompt, run the query without any newlines:
SELECT t.oid, t.typname, t.typelem, t.typdelim, t.typinput, r.rngsubtype, t.typtype, t.typbasetype FROM pg_type AS t LEFT JOIN pg_range AS r ON oid = rngtypid WHERE t.typname IN ( 'int2', 'int4', 'int8', 'oid', 'float4', 'float8', 'text', 'varchar', 'char', 'name', 'bpchar', 'bool', 'bit', 'varbit', 'timestamptz', 'date', 'money', 'bytea', 'point', 'hstore', 'json', 'jsonb', 'cidr', 'inet', 'uuid', 'xml', 'tsvector', 'macaddr', 'citext', 'ltree', 'line', 'lseg', 'box', 'path', 'polygon', 'circle', 'interval', 'time', 'timestamp', 'numeric') OR t.typtype IN ('r', 'e', 'd') OR t.typinput = 'array_in(cstring,oid,integer)'::REGPROCEDURE OR t.typelem != 0;
Describe the problem
The latencies displayed in the CLI do not appear to be accurate always.
Please describe the issue you observed, and any steps we can take to reproduce it:
To Reproduce
What did you do? Describe in your own words.
If possible, provide steps to reproduce the behavior:
cockroach sql ...
For this query, the CLI reports a latency of 2.095s, but it's actually ~10s:
When I add
EXPLAIN
, the CLI reports a 66ms latency, but it's actually ~6s.Environment:
Cluster version:
CLI version:
The text was updated successfully, but these errors were encountered: