getAlby / nostr-wallet-connect

Nostr Wallet Connect (NIP-47) application to allow apps to connect to your node
https://nwc.getalby.com
Apache License 2.0
105 stars 31 forks source link

fix: add composite index for summing payments #140

Closed rolznz closed 1 year ago

rolznz commented 1 year ago

fixes https://github.com/getAlby/nostr-wallet-connect/pull/140 improves performance of query to sum payments in current budget period

bumi commented 1 year ago

Will this update the current DB, too? is this a migration? I still think we need a combined index on app_id, created_at, preimage for that main query. and we might want to include the amount to easily calculate - then PG can get everything from the index and does not need to look into the rows

rolznz commented 1 year ago

@bumi it's an automatic migration.

So we create an index for all 4 fields, should we still add indexes for the individual columns too?

rolznz commented 1 year ago

@bumi updated

rolznz commented 1 year ago

Replaced by https://github.com/getAlby/nostr-wallet-connect/pull/148