nostr-rs-relay
nostr-rs-relay copied to clipboard
feat: tag '&' query
Support draft <insert_nip>
for querying tags with AND
instead of OR
operation.
This branch also greatly improves the query performace of tags by using JOIN
on top level query, see query plan:
NEW
OLD
AND query plan:
I drafted nip for this a while back, but wasn't in the mood for nips so never published it. Someone please do this.
I drafted nip for this a while back, but wasn't in the mood for nips so never published it. Someone please do this.
Yep thats basically what i have here instead of #
to prefix the tag key you use &
["REQ", "a", { "kinds": [2003], "&t": ["movie","4k"] }]
Which is to say that you would like kind: 2003
events having both movie
and 4k
tags
I'll publish the PR for the NIP this week, is this ready for review?
I'll publish the PR for the NIP this week, is this ready for review?
it supports only sqlite, and posgres is mocked out on the branch. Needs some more refactoring in the experimental postgres code to make postgres also work. Except from the postgres support, it's ready.
Is there a blocker for postgres support or was it just not started/completed?
It was only implemented in postgres, it also needs to be added to sqlite code, nothing blocking adding it for sqlite
It was only implemented in postgres, it also needs to be added to sqlite code, nothing blocking adding it for sqlite
Yes, @v0l made an implementation for postgres only. Then I wanted to use that, but I found it's easier to port that to sqlite than to adopt postgres code to the new master branch, so I went with sqlite.
If someone resolves the conflicts between the postgres code and master, it should be fine. I used the same datastructures in the common code what @v0l 's postgres commit used.