kuzu
kuzu copied to clipboard
Rework multi label scan as union all of single label scans
Description
Currently ScanNodeTable internally handles the case of scan from a single label or multiple labels. ScanRelTable and ScanMultiRelTable handles scanning from a single label and multiple labels respectively.
The logic of ScanMultiRelTable
is to organize scanners based on boundNode's label, and for the same batch of input bound node IDs, perform scan over all needed rel tables.
Handling the logic of scanning from multiple labels actually complicate the set of scan operators unnecessarily, as union all can be used to simplify them without additionally performance overheads. Also, potentially union all of single label scans can make the optimization easier to apply index lookup on bound node table scan when scanning from multi rel tables, which is not applied now.