EnterpriseDB / pg_nosql_benchmark

A tool which can be used to benchmark PostgreSQL (JSONB) and MongoDB (BSON)
Other
217 stars 44 forks source link

It looks like the mongo test might be incurring additional serialization cost #5

Closed tjwebb closed 9 years ago

tjwebb commented 9 years ago

https://github.com/EnterpriseDB/pg_nosql_benchmark/blob/master/lib/mongo_func_lib.sh#L54-L57 https://github.com/EnterpriseDB/pg_nosql_benchmark/blob/master/lib/pg_func_lib.sh#L89-L91

The mongo --quiet flag does not suppress result output, and so the mongo command will serialize the resultset via unix socket which could incur additional performance cost; the output is hidden by piping the output to /dev/null, but the work is still being done. I think that the psql command currently is not incurring this cost. Past experience has shown that serialization time for a non-trivial result size can be substantial.

Does this sound right?

gurjeet commented 9 years ago

/cc @vibhorkum . Also see pull request #6, and provide a review/feedback, please.

vibhorkum commented 9 years ago

I don't think psql -q suppress the output. --quiet and -q is used for suppressing extra message which comes on screen. Result is still returned to client.

Test is about if client send query to database, the database should run the query and return the complete result set to client. Test is about how well/fast client machine will get the data from database.

gurjeet commented 9 years ago

Based on comments, including the comment on #6 by @cbandy, and a little code review, I feel this is a non-issue. Hence closing.

/cc @cbandy

tjwebb commented 9 years ago

I haven't had time to test, so I guess I don't really have a case here to make either. I still contend there is a material difference between streaming the resultset to the client and storing the entire thing in a massive buffer.