-
Notifications
You must be signed in to change notification settings - Fork 11
feat(NoTicket): add bulk_insert parameter to executemany for improved INSERT performance #463
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
base: main
Are you sure you want to change the base?
feat(NoTicket): add bulk_insert parameter to executemany for improved INSERT performance #463
Conversation
…rformance - Add bulk_insert flag to executemany() in both sync and async cursors - Concatenate multiple INSERT queries with semicolons when bulk_insert=True - Send with merge_prepared_statement_batches=true query parameter - Support both QMARK and FB_NUMERIC parameter styles - Add validation to ensure only INSERT statements use bulk_insert - Add comprehensive unit tests for both sync and async cursors - Add integration tests for V2 (sync and async) - Add documentation with examples for both parameter styles Co-Authored-By: petro.tiurin@firebolt.io <petro.tiurin@firebolt.io>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
Co-Authored-By: petro.tiurin@firebolt.io <petro.tiurin@firebolt.io>
…meters Co-Authored-By: petro.tiurin@firebolt.io <petro.tiurin@firebolt.io>
Co-Authored-By: petro.tiurin@firebolt.io <petro.tiurin@firebolt.io>
Co-Authored-By: petro.tiurin@firebolt.io <petro.tiurin@firebolt.io>
Co-Authored-By: petro.tiurin@firebolt.io <petro.tiurin@firebolt.io>
…n logic - Replace sqlparse with simple string checks in _validate_bulk_insert_query - Add extra_params parameter to _build_fb_numeric_query_params for extensibility - Refactor _executemany_bulk_insert to preprocess and delegate to existing methods - Use TimeoutController for consistent timeout handling - Parametrize integration tests to avoid duplication Addresses PR feedback from ptiurin on #463 Co-Authored-By: petro.tiurin@firebolt.io <petro.tiurin@firebolt.io>
- Move firebolt.db and firebolt.async_db imports to top of test files - Remove local import statements from inside test functions - Use full module names instead of local aliases Addresses final PR feedback from ptiurin on #463 Co-Authored-By: petro.tiurin@firebolt.io <petro.tiurin@firebolt.io>
docsrc/Connecting_and_queries.rst
Outdated
**Note:** The ``bulk_insert`` parameter only works with INSERT statements. Using it with other | ||
statement types (SELECT, UPDATE, DELETE, etc.) will raise an error. | ||
|
||
Example with QMARK parameter style:: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bulk insert with QMARK is not supported, correct this section
- Remove QMARK parameter style example from bulk_insert documentation - Update note to explicitly state bulk_insert requires fb_numeric - Clarify that using other parameter styles will raise an error Addresses PR feedback from ptiurin on #463 Co-Authored-By: petro.tiurin@firebolt.io <petro.tiurin@firebolt.io>
|
Add bulk_insert parameter to executemany() for improved INSERT performance
Summary
Adds a new
bulk_insert
parameter to theexecutemany()
method in both sync and async cursors. When enabled, this feature concatenates multiple INSERT statements into a single batch request withmerge_prepared_statement_batches=true
, providing significant performance improvements for large data insertions.Key Changes:
bulk_insert
parameter (defaults toFalse
for backward compatibility)?
) and FB_NUMERIC ($1
,$2
) parameter stylesCode Quality Improvements:
Review & Testing Checklist for Human
Critical items requiring manual verification:
Notes
Session Info: Implemented by Devin AI for @ptiurin
Session URL: https://app.devin.ai/sessions/45091a6335424e0798501799fd55a858