Skip to content

Conversation

@github-actions
Copy link

@github-actions github-actions bot commented Jan 5, 2026

Backport of #10356


fixes #10337 (partially)

Change Description

In this PR, we rewrite the query for IsPublicV1Node, which returns a boolean based on if a node has a public or private channel. This particularly fixes an issue sqlite backend as it struggles to efficiently use multiple indexes across seperate columns in one query.

Step to test

cd graph/db

go test -tags test_db_sqlite  -run TestNodeIsPublic -v # ensure we still correctly distinguish between pub & priv

In this commit we add a benchmark to test the performance of
IsPublicNode query.

(cherry picked from commit 86cde4b)
In this commit we updated the IsPublicV1Node query to use UNION
instead of OR, since sqlite struggles to efficiently use
multiple indexes in a single query involving OR conditions across
different columns.

We use UNION ALL since the query doesn't care about duplicates.

(cherry picked from commit ac2cec4)
@github-actions github-actions bot added this to the v0.20.1 milestone Jan 5, 2026
@ziggie1984 ziggie1984 force-pushed the backport-10356-to-v0.20.x-branch branch 2 times, most recently from 756c3fa to bdd0da2 Compare January 5, 2026 15:59
(cherry picked from commit 68f558c)
@ziggie1984 ziggie1984 force-pushed the backport-10356-to-v0.20.x-branch branch from bdd0da2 to 580e820 Compare January 5, 2026 19:32
Copy link
Collaborator

@ziggie1984 ziggie1984 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ziggie1984 ziggie1984 merged commit 9665281 into v0.20.x-branch Jan 5, 2026
38 of 39 checks passed
@ziggie1984 ziggie1984 deleted the backport-10356-to-v0.20.x-branch branch January 5, 2026 22:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants