Skip to content

SQL: Investigate number of queries being performed #3790

Open
@reinkrul

Description

@reinkrul

While working on Prometheus metrics, I discovered that creating a subject (which creates 2 DIDs, did:web and did:nuts) caused 37 SQL queries to be executed. This sounds like too many for me.

Creating a subject

It seems that queries are retried multiple times, maybe due to the way we use GORM?

sql-query-log.txt

E.g.:

INSERT INTO `did_verification_method` (`id`,`key_types`,`weight`,`data`) VALUES ("did:web:localhost%3A8080:iam:45d8be72-0272-4120-83a8-bb097152d315#96ceae8f-074e-42a7-b834-3d7839b6fa74",15,0,"{""id"":""did:web:localhost%3A8080:iam:45d8be72-0272-4120-83a8-bb097152d315#96ceae8f-074e-42a7-b834-3d7839b6fa74"",""type"":""JsonWebKey2020"",""controller"":""did:web:localhost%3A8080:iam:45d8be72-0272-4120-83a8-bb097152d315"",""publicKeyJwk"":{""crv"":""P-256"",""kty"":""EC"",""x"":""e1dbsc52D0I8MXEfLXO-iqK8_g5poKOmcVH9qEOPA9U"",""y"":""TjQZaIPypyR43MDRDIY022oZRsQ6NAdmKyD9N_Q2GQ8""}}") ON CONFLICT DO NOTHING

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions