Skip to content

VictoriaLogs: automatic optimizing the eligible queries ending with sort by (_time desc) limit N #46

Description

@func25

Is your feature request related to a problem? Please describe

Currently, sort by (_time desc) limit N is very slow when the volume of logs retrieved before the sort pipe is large. The best solution is, of course, to reduce the volume by applying more specific filters to narrow the results or by using more fine-grained fields in the stream to split the data into smaller, more manageable groups.

However, there’s a potential opportunity to optimize this path in the same way as the limit in the HTTP query argument.

Describe the solution you'd like

Automatically detecting the sort by (_time desc) limit N pattern and handling it through the same optimized path as the HTTP limit query argument could improve performance.

Describe alternatives you've considered

No response

Additional information

No response

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requestlogsqlIssues related to LogsQL

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions