influxdata / influxdata/influxdb

Why Read next point if we're beyond the limit?

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

Description

https://github.com/influxdata/influxdb/blob/5d84c602c8d68ef71c2e9bb11b5443d9822af67f/influxql/query/iterator.gen.go#L700

Hi, I test this continue will reduce performance.

I think we can do this ( i have tested, have a very good performance):
```go
// Next returns the next point from the iterator.
func (itr *floatLimitIterator) Next() (*FloatPoint, error) {
for {
if itr.opt.Limit > 0 && (itr.n-itr.opt.Offset) > itr.opt.Limit {Stuart Carnie, 1 year ago: • chore(tsdb): Initial commit of tsdb package
return nil, nil
}

p, err := itr.input.Next()
if p == nil || err != nil {
return nil, err
}
```

Contributor guide

Open the contributing guide

Research direction

Start with influxql/query/iterator.gen.go around floatLimitIterator.Next at line 700, and trace how Limit, Offset, n, and input.Next interact. Reproduce the iterator behavior and compare the current and proposed stopping condition; done means preserving correct limit/offset results while addressing the reported unnecessary reads and performance impact.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
databases, performance
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.