Description:
Currently, the relay checks for an active NIP-62(kind:62) vanish request by querying the events table.
If the number of events grows ,this will not be a good practice to scale and will need a additional query.
To be more efficient , we can add a flag to users table (e.g. is_vanished) .
Solution:
- Add a boolean flag (
is_vanished) to the users table.
- Set this flag when a kind:62 event is processed.
- Use this flag for vanish checks instead of querying events table.
Benefit:
- Faster lookups (no event table scan)
- Simpler logic for checking vanish state
- Better scalability as event volume grows
Additional context
Optimize the performance of NIP-62 in PR #418
Description:
Currently, the relay checks for an active NIP-62(kind:62) vanish request by querying the events table.
If the number of events grows ,this will not be a good practice to scale and will need a additional query.
To be more efficient , we can add a flag to users table (e.g.
is_vanished) .Solution:
is_vanished) to the users table.Benefit:
Additional context
Optimize the performance of NIP-62 in PR #418