-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
client.query() slowness #1103
Comments
I appreciate you filing an issue here & would like to try and help; however, I receive multiple issues & request for help on a nearly daily basis and having properly formatted code is something that really makes triaging things easier - could you update your issue text by applying some proper formatting to your code? thanks! |
Thanks, I've updated the post. I didn't know how to insert code properly :) |
My guess would be parsing 6 megabytes of JSON is taking the node process a bit of time, and initially creating & resizing the buffer within node-postgres that needs to hold 6 megabytes is also take a bit of time. Do subsequent queries on the same client run faster? Also, try selecting the json out as text to bypass the For example:
That will select the value out as text instead of json. If you could create a single file that makes a temp table, inserts 6 megs into a json structure, and then queries it I could probably dive in more on my end. |
Nobody should ever store 6MB worth of data as a If you opt for |
Just tried to insert a 180MB file citylots.json from here. The insert took 5 seconds for I think even with 6MB json something similar is happening. UPDATE I was able to get it back as a Use of the |
thanks to all for the replies. g |
@brianc it still will make a worthwhile research to find out how |
Hi,
I'm quite new to postgresql, sorry if the question is a very basic one.
I'm using node 4.4.7, pg 6.0.3 (same happens with 5.x) with postgresql 9.5.3 on centos 7.
I'm using a default.poolsize of 50 and the following function to execute my queries
I actually run a quite long query that tooks about 550ms to run on the psql cli (\timing value), but when I run inside node it tooks about 22 seconds.
The amount of data retrieved is about 6MB and consists of a single row with a single field containing a json object. Running the same query from bash (time psql etc etc) returns about 670ms (I've tried connecting to tcp port and to socket, same results)
other "light" queries that return few kbytes of date runs in milliseconds.
Is there something I can investigate on ? or something I can try to improve the performances ?
thanks
g
The text was updated successfully, but these errors were encountered: