Remove caching the array on flat layout reader, rely on the segment cache instead#4459
Conversation
Signed-off-by: Onur Satici <onur@spiraldb.com>
Benchmarks: TPC-H SF=1 on NVMETable of Results
|
Benchmarks: TPC-H SF=1 on S3Table of Results
|
Codecov Report✅ All modified and coverable lines are covered by tests. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Benchmarks: Statistical and Population GeneticsTable of Results
|
Benchmarks: Clickbench on NVMETable of Results
|
Benchmarks: TPC-DS SF=1 on NVMETable of Results
|
|
It's great that this is somewhat flat, I would adjust the code of the layout reader since we no longer need a sharedfuture iirc and the comments are no longer correct |
|
Mind if we chat through this? Want to double check it fits into 4406. The other reason this existed originally was to avoid parsing the serialized arrays from each segment over and over. Flatbuffers verification was killing us |
| .map_err(Arc::new) | ||
| } | ||
| .boxed() | ||
| .shared()) |
There was a problem hiding this comment.
Remove shared, then let's do it!
|
Unfortunately there is no straightforward way to get rid of shared futures here just yet. Because of the We have to have the Sync bound on both
|
robert3005
left a comment
There was a problem hiding this comment.
One minor thing is that we no longer need the array_future to return VortexResult (that was a case before this pr, just not cleaned up earlier)
Signed-off-by: Onur Satici <onur@spiraldb.com>
With this we don't hold references to arrays in the flat reader, so we can configure the segment cache to have more control on memory held by a layoutref instance. There doesn't seem to be a noticeable regression, other than one query in clickbench datafusion (q23 - 20%).
Another approach could be to have weak references instead.
LayoutRef would still hold cache zone maps and dict values after this change, I did not remove them because they are somewhat bounded