Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change: move GET iterator time conversion out of SQL #2111

Closed

Conversation

mattmundell
Copy link
Contributor

What

Move the ISO time calculations in the "GET" iterators from SQL to C.

Why

Having the iterator do the time conversion is slower when there are many rows with a large offset, because Postgres still does the conversion for every row.

time o m m '<get_info type="nvt" filter="sort-reverse=created rows=10 first=80000"/>' > /tmp/info
patch 0.2, 0.2, 0.16
main 1.8, 2.2, 1.7

Leads to faster SecInfo pages when paging to the end, CPEs in particular.

References

https://www.postgresql.org/docs/current/queries-limit.html 7.6 LIMIT and OFFSET:
The rows skipped by an OFFSET clause still have to be computed inside the server; therefore a large OFFSET might be inefficient.

@mattmundell mattmundell changed the title Move iterator iso time Change: move GET iterator time conversion out of SQL Nov 20, 2023
Copy link

Conventional Commits Report

Type Number
Changed 1

🚀 Conventional commits found.

@mattmundell
Copy link
Contributor Author

Replaced by /pull/2112

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant