On https:/github.com/fiatjaf/relayer I've done just event table, with fancy Postgres indexes for the tags, but I have no idea about performance. I believe #[1] used a separate table for tags on nostr-rs-relay, but I am not sure. #[0]?

As far as I know randomness of keys affect insert performance, not read.

Reply to this note

Please Login to reply.

Discussion

is that enough info?

Nostream uses a jsonb field for tags. But a tags table with correct indexes is more performant.

cc #[5]

I have about 20M tags on my DB it's hungry on CPU because tag quieries are usually the most common, threads and reactions, notifications etc, author lookups are much cheaper

That was my main concern... I think I will do a separate table to make queries slightly faster.

Correction: 36M