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
Currently, when running a query on a JSON column, the following sequence of events happens:
tree.GetField loads the entire on-disk representation of the JSON document into memory by calling tree.JSONDoc.byte(). This representation is currently a JSON string.
tree.GetField converts this string into a types.JSONDocument by de-serializing the string into a golang map.
Before being displayed to the user or send over the wire by the server, it must be re-serialized back into a string.
If the document is not inspected or modified by the query, we are deserializing and reserializing the document unnecessarily. I have benchmarks where this is 30% of the runtime for a simple select query.
We should have an optimization that detects when the structure of a JSON column is not actually needed for resolving a query, and treats the document as a text string instead.
The text was updated successfully, but these errors were encountered:
Currently, when running a query on a JSON column, the following sequence of events happens:
tree.GetField
loads the entire on-disk representation of the JSON document into memory by callingtree.JSONDoc.byte()
. This representation is currently a JSON string.tree.GetField
converts this string into atypes.JSONDocument
by de-serializing the string into a golang map.If the document is not inspected or modified by the query, we are deserializing and reserializing the document unnecessarily. I have benchmarks where this is 30% of the runtime for a simple select query.
We should have an optimization that detects when the structure of a JSON column is not actually needed for resolving a query, and treats the document as a text string instead.
The text was updated successfully, but these errors were encountered: