Closed bryanchriswhite closed 1 year ago
Post #147, I hypothesize that a query that traverses a path like AuthzExec -> AuthzExecMessage -> Message -> Transaction -> Event
is likely to be one of (if not) the deepest paths available
Here's the backbone of that query in GQL:
query deepQuery {
authzExecs (first: 100) {
nodes {
message {
transaction {
events {
nodes {
id
}
}
}
}
subMessages {
nodes {
message {
transaction {
messages {
nodes {
id
}
}
events {
nodes {
id
}
}
}
}
}
}
}
}
}
Counting all records in a table causes a sequential scan over that table which is a costly operation. Including totalCount
s at each edge maximizes this cost with respect to a given query. Additionally, as load should also scale with the amount of data requested, we can fill out this backbone by asking for all fields on all nodes:
query deepQuery {
authzExecs (first: 100) {
totalCount
nodes {
id
grantee
message {
id
typeUrl
json
transaction {
id
gasUsed
gasWanted
signerAddress
events {
totalCount
nodes {
id
type
attributes
log
}
}
}
}
subMessages {
totalCount
nodes {
message {
id
typeUrl
json
transaction {
id
gasUsed
gasWanted
signerAddress
messages {
totalCount
nodes {
id
typeUrl
json
}
}
events {
totalCount
nodes {
id
type
attributes
log
}
}
}
}
}
}
}
}
}
Closing this as the GQL query should be sufficient for now. This may change if the graphql api turns out to be a bottleneck to DB performance.
Proposal
COPY
command.To get a sense of how "stressed" both the graphql API server and the DB server are, I think we can measure CPU & memory usage over time and query response time.