kuzu icon indicating copy to clipboard operation
kuzu copied to clipboard

Optimization: Improve result collector performance

Open acquamarin opened this issue 5 months ago • 0 comments

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    │
└─────────────────────────────────┘

acquamarin avatar Aug 29 '24 03:08 acquamarin