KipData / FnckSQL

SQL as a Function for Rust
Apache License 2.0
567 stars 48 forks source link

Perf: Optimize the implementation of `IndexIter` #190

Closed KKould closed 8 months ago

KKould commented 8 months ago

Feature Request

Currently, the main performance issue: https://github.com/KipData/FnckSQL/issues/162#issuecomment-2025980995 in the benchmark is the execution of IndexIter

The current implementation of IndexIter is relatively redundant and cumbersome. Its main principle is to use three iterators in order: expression -> index value -> tuple (the primary key is expression -> tuple) , the current implementation is relatively poor in readability, is there a better implementation?

https://github.com/KipData/FnckSQL/blob/173c39571f560f4b733c8b0608755653ec9dcf50/src/storage/mod.rs#L146-L356

KKould commented 8 months ago

The previous implementation was temporary. Since Index is now almost complete, I will implement iterators for each index to avoid prediction difficulties caused by a large number of branches.