-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
What could explain long time to process a query? #3467
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
Comments
probably |
note: due to your column being |
Does it make a difference if I use I've been experimenting with the two, and I seem to be getting better performance with |
This will only tell you how long it takes to execute the query plan. It will not tell you how long it takes to send the query results across the network.
Is it safe to assume the otel is on your node.js server? If so, I believe you are seeing how long it takes to buffer the query. Here is an example: create table foo (bar jsonb primary key);
insert into foo (bar) values ('{"value": "some giant string that is 1GiB large..."}');
explain analyze select bar from foo;
QUERY PLAN
--------------------------------------------------------------------------------------------------
Seq Scan on foo (cost=0.00..23.60 rows=1360 width=32) (actual time=0.027..0.028 rows=1 loops=1)
Planning Time: 0.201 ms
Execution Time: 0.048 ms
(3 rows) The query plan is sub 1ms. How long do you think it will take a node.js server to buffer 1GiB of data? A lot longer than 1ms. |
|
I have a query that returns a lot of data (large JSON blob).
If I run this query on the database, it takes less than 1m to execute (using
EXLAIN ANALYZE
).However, when I observe the same query using open telemetry, it averages 40-50ms.
The database is hosted on same network with latency less than 1m.
What could explain the massive (~40ms) difference between how long the query is seen to execute using
EXPLAIN ANALYZE
and how long it takes to process using Node.js?The text was updated successfully, but these errors were encountered: