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

Requests with after/before-time have unpredictable postgres query plans. #1518

Open
urtho opened this issue Apr 27, 2023 · 0 comments
Open
Labels
new-feature-request Feature request that needs triage Team Lamprey

Comments

@urtho
Copy link
Contributor

urtho commented Apr 27, 2023

Problem

Queries with after/before-time have unpredictable performance due to Postgres optimizer issues with joins with block_header table.
Postgres 14 appears to create even worse performing query plans then PG13 when joining over large time ranges with block header table.

Solution

Avoid block_header joins by converting the after/before-time requests to min/max-round requests - eg by using CTE to establish the round number boundaries first.

Urgency

Requests with after/before-time parameters basically do not work at Algonode due to a lot of extra indexes and bad planner guesses even with extended stats.

@urtho urtho added the new-feature-request Feature request that needs triage label Apr 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new-feature-request Feature request that needs triage Team Lamprey
Projects
None yet
Development

No branches or pull requests

2 participants