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
Contracts REST API endpoints /contracts?limit=100 and /contracts/{id} show much lower RPS with high number of entities (around 100M).
Initial investigation points to the inefficiency of index entity__id_type on (id, type) used in the SQL query shared by both endpoints. When there are very few contracts entities among the hundreds of millions rows in the table, it'll take much longer to find the matching rows.
Two possible ways to fix
drop index entity__id_type, create a new index on just type, or (type, id), research if there's negative performance impact to other endpoints which depend on index entity__id_type
rewrite the getContracts SQL query in contractController.js to not use index entity__id_type
Steps to reproduce
Run k6 performance tests contracts and contractsId.
Additional context
No response
Hedera network
other
Version
v0.119.0
Operating system
None
The text was updated successfully, but these errors were encountered:
Also I tried to k6 performance test on contracts and contractsId but got the below error.Could you please guide me on how to run this test?
WARN[0003] Request Failed error="Get \"http://localhost/api/v1/contracts?limit=100\": dial tcp 127.0.0.1:80: connectex: No connection could be made because the target machine actively refused it."
Description
Contracts REST API endpoints
/contracts?limit=100
and/contracts/{id}
show much lower RPS with high number of entities (around 100M).Initial investigation points to the inefficiency of index
entity__id_type
on(id, type)
used in the SQL query shared by both endpoints. When there are very few contracts entities among the hundreds of millions rows in the table, it'll take much longer to find the matching rows.Two possible ways to fix
entity__id_type
, create a new index on justtype
, or(type, id)
, research if there's negative performance impact to other endpoints which depend on indexentity__id_type
getContracts
SQL query incontractController.js
to not use indexentity__id_type
Steps to reproduce
Run k6 performance tests
contracts
andcontractsId
.Additional context
No response
Hedera network
other
Version
v0.119.0
Operating system
None
The text was updated successfully, but these errors were encountered: