Db Size & Performance Question (theoretical)

If I remember correctly an entire project is loaded in order to have our continuous note scroll :+1:. Also, that a large enough db memory can slow the system. So, would linking to a category dedicated to Agenda attachments make a difference in normal operating performance? I’m talking one attachment per note.

Please feel free to embellish or correct.

You mean managing attachments like they do in Obsidian?
I have far too many attachments in Agenda and have thought about this several times.
I haven’t yet found a practical solution for just linking attachments and storing the files elsewhere. And that’s on both macOS and iOS/iPadOS.
I’ve probably already misused Agenda and fear that after several years of intensive use, this will have a negative impact on performance.

@Roms Because the Agenda attachments took up a lot of space on my iPhone and this situation would probably only worsen, I decided to save the files outside of Agenda in an iCloud folder and in Agenda only retain links to them. The main advantage for me was the automatic storage management done by Apple (in terms of keeping the files in the cloud and downloading them only as needed).

To accomplish this I at first created a shortcut for opening a file located in this iCloud folder when given the filename (with apple preview because at the moment I only attach PDFs). In Agenda when clicking on the corresponding link it just runs this shortcut with the filename as input (using the x-callback-url support in Agenda). The markdown of the link in Agenda looks sth. like this:

[Filename](shortcuts://run-shortcut?name=open_file&input=filename.pdf)

Then for easier management I created several other shortcuts for

  • creating this markdown text and copying it to the clipboard (when pasted in Agenda it converts automatically to a link; this shortcut takes a file as input),
  • creating an empty pdf and copying the markdown link to it to the clipboard (for handwritten notes),
  • renaming an attachment (works by selecting the link in Agenda and then running the shortcut; asks for the new filename, renames the file and the link in Agenda),
  • deleting an attachment (also select the link in Agenda and the shortcut deletes the file and the link in the note).

This works good for me on all three platforms (although it took some time to set up). Maybe something like this could also be a solution for you, I didn’t really find another way to have the attachments outside of Agenda. It is a pain to manually migrate a ‚real‘ attachment to iCloud though, but another big advantage for me is that now I can extract all the notes in markdown format and import them in another notes program (that support x-callback-url-schemes) if sth. happens to Agenda or I have another reason to switch apps. I think otherwise the attachments are lost when exporting to markdown.

Thanks, that’s the way to do it, but:

  • I can’t replicate it. I’ve created simple shortcuts myself, but it’s too complicated for me.
  • ChatGPT can do it, but the instructions have too many errors that I can’t correct.
  • @drewmccormack Why isn’t this option offered directly in Agenda?
    1. Insert and embed file (already exists).
    2. Insert link to the file and save the file in an iCloud folder (my wish).
    3. or alternatively, an Agenda shortcut with this function. (Maybe someone could build this and make it available to all Agenda users?)

We allow you to link to any file anywhere. As long as the link is correct, it will work.

The problem is when you move between devices. The best is thus generally to link to a web address, which should work everywhere. You could setup Dropbox, and use the web links.

I think iCloud Drive would work too, but be careful there. The links may only work for a month or so. Not entirely sure.

We’ll take along that it would be good to automatically handle stuff in iCloud Drive.

Various methods to handle attachments wasn’t the question though I’m sure some will appreciate the ideas.
@drewmccormack I wanted to know if all attachments were stored in a category containing only a project(s), containing only one note = one attachment, would the db performance improve vs having multiple attachments in the current active project?

PS: I’m currently using .hookfile links, totally robust, and since the attachment is actually a link formatted as an attachment to the actual file in finder, it requires a minuscule amount of memory. ie; a 6Mb file attachment is < 600kb.

I would think something like a hook file should be fast. What is slower are images, because Agenda has to load them from disk to show them inline.

In general, fewer attachments per note should be faster. Agenda loads the notes on screen, plus a few just off screen.

A note with 10 images will be slower to load that a note with 1 image, so 10 notes with 1 image each should load a bit faster, because some of them may be completely offscreen.

I’m surprised a hook file would cause slowness though.

I didn’t state that paragraph very well. I have no problems with db speed or size. The reason I was asking is for syncing with iOS, if I decide to I’ll probably have to drop the hook file method. The second best way best way I see is to create normal Agenda attachments in a project of their own and link to them from the note being worked in. Opening the linked attachment in a separate window really wouldn’t be too bad.

I also got the example size wrong with the hook file, it’s a 7Mb image that takes 80 bytes😊.

I would say linking is challenging across devices in general. Generally, whatever you link will not exist at the same location on each device.

Some exceptions are web links, and app links. It could be that an app uses a custom schema, and that that means you can link to things in the app and have it work on different devices. Agenda has such a schema (eg agenda://note/…)