You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Double the batch size up to 8, if we only see tombstones (#24275)
Turns out if you do .first() you are only fetching one row at a time. This is a problem since if you have 100 deleted rows, you will end up dong 100 database queries. Instead dynamically resize the batch. I have put a more conservative limit of 8 to see how much it helps but it could be larger.
In general, we should perhaps always be using this technique since currently the client just guesses the size_hint. If we use filter, we always fetch 100 rows. Instead we could be using dynamic sizing.
Similarly, if the client asks for take(10000) rows, we are going to fetch up to 5k. This might be too large if those rows are big. So some dynamic sizing with proper estimates of size might help there as well.
For now, do the simple, obvious thing.
GitOrigin-RevId: d8b69fcb370ce97399da7e94a55d0ffc277bfd65
0 commit comments