-
Notifications
You must be signed in to change notification settings - Fork 11.2k
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
[GraphQL/Events] Disable filtering on both event_type
and emitting_module
#18740
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
3 Skipped Deployments
|
By the way we'll need to apply the schema changes (removal of some columns in event tables that won't be used anymore in graphql) in this commit as well before merging this PR into |
f939ba2
to
beadcc6
Compare
Heads up @wlmyng and @emmazzz -- I took the liberty of simplifying I also took the opportunity to clean up some other things that were maybe a bit problematic:
|
… respective types rename ev_cursor to just cursor use bytea_literal in pg module instead of individually in digest and sui_address logic for constructing the raw query, which is a single roundtrip consisting of multiple ctes to determine the tx and ev range i think its working? time for some tests and cleanup introduce new cte field to RawQuery remove unused code for now, fetch checkpoint_viewed_at's tx upper split things out so hopefully its easier to review and makes more sense compartmentalized like this? tx digest - test digest no events, and then digest with events test base case of no filter also works
Seeing as we don't support compound filters for events, we don't need to go to the trouble of using CTEs just yet.
9cf7d94
to
5150155
Compare
event_type
and emitting_module
…itting… (#19135) …_module` (#18740) ## Description Cherry pick event indexer + graphql changes. ## Test plan How did you test the new or updated feature? --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: - [ ] REST API: --------- Co-authored-by: wlmyng <127570466+wlmyng@users.noreply.github.com> Co-authored-by: Lu Zhang <8418040+longbowlu@users.noreply.github.com>
Description
From GraphQL performance benchmarks, we observed that events queries filtered on both
event_type
andemitting_module
frequently time out. Some approaches were explored to support this, but ultimately we will do away with this combination for the time being.The new paginated events query consists of a few roundtrips, first to collect a list of
tx_sequence_number
andevent_sequence_number
, and then a subsequent query composed of a series ofUNION ALL
s to leverage the index on theevents
table.If filters are not specified for
event_type
,emitting_module
, orsender
, then we can query theevents
table directly.Test plan
event_type
andemitting_module
will errortx_sequence_number
, and default to the cursor'sevent_sequence_number
exclusive as the starting or ending pointevent_type
filter worksevent_type
with type param instantiation worksRelease notes
Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required.
For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates.
eventType
andemittingModule