kuzu
kuzu copied to clipboard
Optimization: Improve result collector performance
Description
In a typical scan query, the resultcollector takes more time in accumulating result than scanning the actual table. We should consider optimize the performance of our result collector.
kuzu> profile match (c:Comment) return c.ID;
┌─────────────────────────────────┐
│┌───────────────────────────────┐│
││ Physical Plan ││
│└───────────────────────────────┘│
└─────────────────────────────────┘
┌─────────────────────────────────┐
│ RESULT_COLLECTOR │
│ --------------------------- │
│ Expressions: explain result │
│ --------------------------- │
│ NumOutputTuples: 0 │
│ --------------------------- │
│ ExecutionTime: 0.000000 │
└────────────────┬────────────────┘
┌────────────────┴────────────────┐
│ PROFILE │
│ --------------------------- │
│ --------------------------- │
│ NumOutputTuples: 0 │
│ --------------------------- │
│ ExecutionTime: 0.000000 │
└────────────────┬────────────────┘
┌────────────────┴────────────────┐
│ RESULT_COLLECTOR │
│ --------------------------- │
│ Expressions: c.ID │
│ --------------------------- │
│ NumOutputTuples: 0 │
│ --------------------------- │
│ ExecutionTime: 1308.905000 │
└────────────────┬────────────────┘
┌────────────────┴────────────────┐
│ PROJECTION │
│ --------------------------- │
│ Expressions: c.ID │
│ --------------------------- │
│ NumOutputTuples: 107469 │
│ --------------------------- │
│ ExecutionTime: 7.863000 │
└────────────────┬────────────────┘
┌────────────────┴────────────────┐
│ SCAN_NODE_TABLE │
│ --------------------------- │
│ Tables: Comment │
│ Properties: c.ID │
│ --------------------------- │
│ NumOutputTuples: 0 │
│ --------------------------- │
│ ExecutionTime: 876.610000 │
└─────────────────────────────────┘