crypto-com / crypto-com/chain-indexing
Problem: view_transactions_total could be simplified with a materialized view
- Dominant language
- Go
- Stars
- 34
- Forks
- 32
- PR merge metrics
- No merged PRs in 30d
Description
```sql
create materialized view view_transactions_total as (
select block_height as identity, count(id) as total from view_transactions group by block_height
);
```
after projection task updated `view_transactions`, call `refresh materialized view view_transactions_total`;
if you want to populate the zero rows, then something like this:
```sql
create materialized view view_transactions_total as (
select b.height, COALESCE(t.total, 0)
from view_blocks b left outer join
(select block_height as identity, count(id) as total from view_transactions group by block_height) t
on (t.identity=b.height)
);
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.