Jay on Nostr: I'd need to run it myself but it seems a bit slow. Do you have indexes on ...
I'd need to run it myself but it seems a bit slow. Do you have indexes on NostrUser.pubkey and the NostrEvent.event_id? Whatever properties you use often in your queries should have indexes. This will make it so that when you have a new event, the database doesn't need to query every author. It will also help to put a uniqueness constraint on NostrUser pubkeys.
Also, you dont need the 'author' property if the relationship exists. You'd query a path that contains the author pubkey (or keys) you want and find the event via the relationship or vice versa.
Published at
2025-02-09 15:20:56Event JSON
{
"id": "040671d0c197209e375db1436410bf1ec0c6e09940cd9402cda982ef5b4aa984",
"pubkey": "7ed7d5c3abf06fa1c00f71f879856769f46ac92354c129b3ed5562506927e200",
"created_at": 1739114456,
"kind": 1,
"tags": [
[
"e",
"8fbb005b53bfc459ccf009385eaa62789b536a5498d919544f34bf78444cc1e9",
"",
"root"
],
[
"p",
"7ed7d5c3abf06fa1c00f71f879856769f46ac92354c129b3ed5562506927e200"
],
[
"p",
"e5272de914bd301755c439b88e6959a43c9d2664831f093c51e9c799a16a102f"
],
[
"r",
"NostrUser.pubkey"
],
[
"r",
"NostrEvent.event"
]
],
"content": "I'd need to run it myself but it seems a bit slow. Do you have indexes on NostrUser.pubkey and the NostrEvent.event_id? Whatever properties you use often in your queries should have indexes. This will make it so that when you have a new event, the database doesn't need to query every author. It will also help to put a uniqueness constraint on NostrUser pubkeys.\n\nAlso, you dont need the 'author' property if the relationship exists. You'd query a path that contains the author pubkey (or keys) you want and find the event via the relationship or vice versa.",
"sig": "e09632416f3bc366fe47c5dd3fec240e16e329a5a1eb2eae09f132844785cc0e3ac2bebaa8dc46a0b67adbf7c288e167bd2b39a681c423bbfcf3604e94be3ae2"
}