influxdata / influxdata/influxdb

Handle limit pushdown in last cache

Open
#25,968 0 comments 0 reactions 0 assignees View on GitHub
v3
Dominant language
Rust
Stars
31.7k
Forks
3.7k
Avg merge
13h 37m
Merged PRs (30d)
8

Description

### Problem statement

The last cache does not handle limit pushdown:
https://github.com/influxdata/influxdb/blob/fa18b6d8da6c4e11ebbf5c042d4004cdab6acd63/influxdb3_cache/src/last_cache/table_function.rs#L76

### Proposed solution

Handle limit pushdown in the last cache. This was done in the distinct cache, so the solution _may_ be able to draw on the implementation there (see where limit is handled internally [here](https://github.com/influxdata/influxdb/blob/fa18b6d8da6c4e11ebbf5c042d4004cdab6acd63/influxdb3_cache/src/distinct_cache/cache.rs#L230)).

The `LastCacheExec`, should output the limit pushed down to the table function scan, as was done for the distinct cache.

### Additional context

See [slack thread](https://influxdata.slack.com/archives/C06BQA608J3/p1738705346635579).

Contributor guide

Open the contributing guide

Research direction

Start in influxdb3_cache/src/last_cache/table_function.rs at the referenced limit-pushdown location, then compare the implementation in influxdb3_cache/src/distinct_cache/cache.rs around line 230. Trace LastCacheExec and confirm that the table function scan receives and outputs the pushed-down limit; done means last-cache scans handle limits like the distinct cache.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
databases
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.