You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now, we are kind of guessing what would be efficient and what won't be — but ideally we should try to run simulations to test our hypothesis.
The things we'd want to benchmark could be startup times and response times for various endpoints under some DB sizes (e.g., DB with 1M accounts, notes, nullifiers etc.).
We already have several approaches we want to compare, like:
Is UNION ALL approach better than just having four separate queries?
What is more efficient:
SELECT0AS type, block_num, slot, NULL, value
FROM
account_storage_slot_updates AS a
WHERE
account_id = ?1AND
block_num > ?2AND
block_num <= ?3AND
NOT EXISTS(
SELECT1FROM account_storage_slot_updates AS b
WHEREb.account_id= ?1ANDa.slot=b.slotANDa.block_num<b.block_numANDb.block_num<= ?3
)
or
SELECT0AS type, a.block_num, a.slot, NULL, a.valueFROM
account_storage_slot_updates AS a
INNER JOIN (
SELECT
account_id, slot, MAX(block_num) AS block_num
FROM
account_storage_slot_updates
WHERE
account_id = ?1AND
block_num > ?2AND
block_num <= ?3ANDGROUP BY
slot
) b ONa.account_id=b.account_idANDa.block_num=b.block_numANDa.slot=b.slot
The text was updated successfully, but these errors were encountered:
One can often intuit performance (broadly) from explain query plan <..>. At minimum this usually indicates missing indices; or running into query optimiser limitations.
I'm wondering if there isn't some automated testing one can do for all queries, e.g. ensure no query results in a scan .... Probably not really generally tractable.
According to @bobbinth suggestions from #554:
Right now, we are kind of guessing what would be efficient and what won't be — but ideally we should try to run simulations to test our hypothesis.
The things we'd want to benchmark could be startup times and response times for various endpoints under some DB sizes (e.g., DB with 1M accounts, notes, nullifiers etc.).
We already have several approaches we want to compare, like:
UNION ALL
approach better than just having four separate queries?or
The text was updated successfully, but these errors were encountered: