Update timer and fix kuzudb queries #12
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes
Closes #7
Closes #8
Timer update
Previously timer only record query execution time and ignore result iteration time. Depends on the database architecture, result iteration time may also be significant.
Disclaimer: I might be wrong about Neo4j architecture, so feel free to point it out.
Based on previous observation of using Neo4j, Neo4j server client model doesn't materialize all query result by the end of
session.run()
. Instead, it relies on user's pulling action (i.e. consuming result) to continue execution. For example, if the query returns 10K tuple,session.run()
might only materialize the first batch, say 1K. And as user requests more data, it will incrementally materialize the rest 9K tuples batch by batch. This makes a lot of sense in server-client architecture since we don't want to send large amount of data through network.On the other hand, Kùzu is embedded and materialize all result by the end of
connection.execute()
. So I think the most straight forward comparison is to measure end-to-end time, i.e. the time from inputing a string query to the time of getting back an arrow table.Timer is modified in both Kùzu and Neo4j in the same way.
Kùzu query update
For Kùzu team, I think we should try to be drop in replacement of Cypher so that user doesn't need to convert their queries. We should be able to do this for read/write statement for sure.
Neo4j result
Kùzu result