Skip to content

Conversation

@vietj
Copy link
Member

@vietj vietj commented Apr 28, 2025

Motivation:

The implementation of prepared statement tries to accomodate both a lazy mode and a non lazy one, leading to the utilization of a future to unify the obtention of the prepared statement.

This is clearly suboptimal for the common case, since lazy prepared statement is only necessary when meeting indeterminate prepared statement (ambiguous) that requires a tuple for an actual preparation.

In addition the execution is done using a context comparison which fails when on a duplicated context.

Changes:

Use the context in thread comparison instead of context equality.

Make a prepared statement base which has two implementations lazy/direct which are both optimized for their specific cases.

Motivation:

The implementation of prepared statement tries to accomodate both a lazy mode and a non lazy one, leading to the utilization of a future to unify the obtention of the prepared statement.

This is clearly suboptimal for the common case, since lazy prepared statement is only necessary when meeting indeterminate prepared statement (ambiguous) that requires a tuple for an actual preparation.

In addition the execution is done using a context comparison which fails when on a duplicated context.

Changes:

Use the context in thread comparison instead of context equality.

Make a prepared statement base which has two implementations lazy/direct which are both optimized for their specific cases.
@vietj vietj force-pushed the improve-prepared-statement-impl-2 branch from d728441 to c40629e Compare April 28, 2025 07:04
@vietj vietj merged commit c761afb into master Apr 28, 2025
18 checks passed
@vietj vietj deleted the improve-prepared-statement-impl-2 branch April 28, 2025 07:25
@vietj vietj added this to the 5.0.0 milestone Apr 28, 2025
@vietj vietj self-assigned this Apr 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants