Global Feed Post Login
Replying to Avatar ᴛʜᴇ ᴅᴇᴀᴛʜ ᴏꜰ ᴍʟᴇᴋᴜ

i must make a note to implement count on #orly - the database is designed to avoid needing to decode events before it is certain they are result candidates, so it can actually do it, at least for author/kind/timestamp filters, without decoding a single event stored in the database. probably i need to add a new index that covers the gap with tags, like pubkey/tag/timestamp, and the count function never has to decode any events.

my main objection to count had to do with the excessive work required that was basically the same as if you actually just fetch the event and do that processing locally. but with the necessary indexes that doesn't have to happen.

trading off the size of the database for the speed of search and count is what i'm talking about.

there definitely is algorithms that would run a lot faster if they could do counts

Avatar
ᴛʜᴇ ᴅᴇᴀᴛʜ ᴏꜰ ᴍʟᴇᴋᴜ 1mo ago

btw, #ORLY now implements this, for anyone looking. the pubkey/kind/created_at index enables counting events without decoding them.

you'll see in the relayinfo that it claims support for the count nip

Reply to this note

Please Login to reply.

Discussion

No replies yet.