Skip to content

Remove useless filtring in events&actions sql#134

Open
glyh wants to merge 3 commits into
mainfrom
lyh/remove-useless-filtering-event-actions-sql
Open

Remove useless filtring in events&actions sql#134
glyh wants to merge 3 commits into
mainfrom
lyh/remove-useless-filtering-event-actions-sql

Conversation

@glyh

@glyh glyh commented Nov 3, 2025

Copy link
Copy Markdown
Member

This is confirmed by running this on a online archive db:

 select COUNT(*) from blocks where id = parent_id;
 count 
-------
     0
(1 row)

pending_chain
WHERE 1=1
${
// If fromAsNum is not undefined, then we have also set toAsNum and can safely query the range

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I think these are auto format.

Comment thread .gitignore

# docker-compose postgres volumes
db/
/db/

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Any reason for this diff?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

src/db will be ignored without this

FROM
blocks b
INNER JOIN pending_chain ON b.id = pending_chain.parent_id
AND pending_chain.id <> pending_chain.parent_id

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I am not confident that this can never be true. I just don't know the Mina spec well enough. What is gained by removing this filter? Is the performance notably better?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

No I don't think the perf would be much better. It's just this logic is very confusing here when I'm reading the code

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.

2 participants