-
Notifications
You must be signed in to change notification settings - Fork 73
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
Elasticsearch.StreamingStore behaviour or something alike #31
Comments
This can also play well when data is ingested from a GenStage producer. |
This fixes the performance problem noted in #31 with the offset and limit strategy. If the store returns a stream, the queries on most SQL databases will be more efficient.
@imranismail I have a PR open to do this: #36. Do you have any feedback? |
[#31] Base Store behaviour on streams
@danielberkompas @imranismail The switch to streams impacts the ability to preload relationships |
I think the solution might be to use a database cursor instead of |
Reason being we could utilize
Repo.stream
withRepo.transaction
with timeout of infinity.LIMIT + OFFSET is linear when getting the last 100 in a 1 million row table. I'll have to go through the first 99900. Using a cursor or a stream with a timeout of infinity can help in this case.
Right now I avoid having long queries (waiting for the offset to reach 99900) by doing something like this:
But streaming to the end in one shot would be much much preferred.
The text was updated successfully, but these errors were encountered: