threefoldtech / tfchain_graphql

Graphql for TFchain
Apache License 2.0
2 stars 3 forks source link

denormalize graphql schema #134

Open MarioBassem opened 1 year ago

MarioBassem commented 1 year ago

currently, querying simple information from the postgres db requires multiple table joins, expensive calculations and have really bad performance. Hence, some data denormalization is needed, and if possible, doing the required calculations on the fly as events are reported.

sameh-farouk commented 7 months ago

I noticed that our processor DB didn't use indexes at all. It is crucial to add database indexes to the entity fields on which one expects filtering and ordering. I would look first into adding indexes to our schema as the lack of indices is the most common cause of slow API queries.