Skip to content
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

feat: add setting for estimating time ranges using bucket count queries #646

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

pvlugter
Copy link
Contributor

To make it possible to disable the bucket count queries, to use alternative indexes for the by-slice queries.

@@ -307,11 +307,16 @@ private[r2dbc] class PostgresDurableStateDao(executorProvider: R2dbcExecutorProv
else
"SELECT persistence_id, revision, db_timestamp, CURRENT_TIMESTAMP AS read_db_timestamp, state_ser_id, state_ser_manifest, state_payload "

val sliceFilter = {
if (settings.querySettings.estimateTimeRange) sliceCondition(minSlice, maxSlice)
else s"slice BETWEEN $minSlice AND $maxSlice"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for reference, it was changed to IN instead of BETWEEN in #249
but it can be different with the new index

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, with the new index the IN becomes a separate filter rather than an index scan condition. Not sure if we should base this switch on the estimate-time-range setting, or have a separate setting or something.

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