What is Nostr?
Alex /
npub1q3s…d26p
2024-07-18 17:33:59

Alex on Nostr: I have come to the conclusion that the only way to do fast tag filters in an SQL ...

I have come to the conclusion that the only way to do fast tag filters in an SQL database is to duplicate the id, kind, pubkey, and created_at column of the event on EVERY SINGLE tag row, with ALL THE INDEXES of events. Because you need to be able to filter down the tags with the exact same filter you filter events.

Joining the tables doesn't cut it. There is absolutely no way to make the query planner not pull out every single tag pair for a query even when you only need a couple events. Unless you filter it down yourself.
Author Public Key
npub1q3sle0kvfsehgsuexttt3ugjd8xdklxfwwkh559wxckmzddywnws6cd26p