Reuse HTTP / TCP connection between calls (`execute`)
MrNeocore opened this issue · 1 comments
Currently, every call (Cursor.execute
) to Pinot establishes a new HTTP connection.
This quickly adds latency whenever "many" queries are executed.
I've measured somewhere around ~20ms overhead per call - which, multiplied by N requests to serve a more complex business query quickly adds significant delay.
Using requests.Session
seems like the standard way of enabling connection reuse and improve performance in those cases.
Should it be done at the Cursor or Connection level ?
Handling this at the Cursor level seems like the safest and more future-proof approach and keeps the API predictable (no state between cursors) while still addressing the performance issue.
Is there another alternative worth exploring ?