Apparently reached Collection Size limit. What now?

You can delete all Reschedule and Set Due Date entries, though.

Run the following in the Debug Console.

mw.col.db.execute("delete from revlog where type = 5")
mw.col.db.execute("delete from revlog where type = 4 and factor !=0")
mw.col.set_schema_modified()
1 Like

FWIW, I’d try downsizing the text on the notes. 10-20 KB on average is quite a lot. For reference, >95% of my sentence notes have a text size of <1 KB and ~45% are < 500 Bytes.

If your cards have a fixed pattern, common parts should be moved to the template and only variable parts to fields. This also makes it easier to search and to change the layout later. HTML that has to stay in fields should be optimized: Strip white space, redundant tags and properties, make repeated style tags into CSS classes and move them to the template, etc.

Sadly, unlike compressing the HTML, the template approach changes semantics and is probably hard to automate. But maybe there’s a few particularly huge notes you could treat like this, and create new ones only in the more compact format. JavaScript in the template can detect the note format and do The Right Thingā„¢. At the very least this could help slow down the growth rate.

2 Likes

All my styling is done in card templates. All my notes look the same.

Here is what an average note of mine looks like.

  • This note in question for example has 77 cloze cards (example shown in the picture). The size of this note is 18KB. All styling like I said is done in card templates, so all my notes look the same.

This has removed a further 3 MB. So thanks!

image


I am aware now that

  • I have 2M reviews. Thats a lot of revlog on my 100k cards. That would make a ton of my collection memory

I either have to

1- Reduce my revlog up to a certain point which would damage the accuracy of my FSRS

2- Split up my decks (I am trying really hard to find decks I can give up on and send to a different profile, but at some point there will be no more decks for me to sye bye-bye to, so this is a non-option in the long run)

3- Have a custom sync server which I have no idea of setting up and where to begin.

4 - Delete unwanted decks (which I already have). There are about 4000 suspended cards which I could delete, the problem is that they are part of notes which I cannot remove.

5 - Find a way to optimize the memory size of each of my notes. (It doesn’t seem that the way I am constructing my notes is the issue though I am willing to explore that further.)

6 - Come into terms with using Anki only on my primary device, running the risk of not being able to back up or sync across all my other devices and waiting for however long that Anki allows a memory expansion service.


In any case, I have 45 MB of free space now. Sooner or later I am going to be here again and I am going to have to do something about it.

Commands do not neccessarily provide output. The commands still take effect though.

So if you check the size again, it should be a bit smaller, if you had revlog type 5 and 4 which now where deleted.

Edit: Seems like you found it out already.

1 Like

Assuming that you don’t care about the accuracy of Stats (particularly, the reviews per day graph), you can clear the revlogs of cards that you have already deleted.

General advice: Please make a backup before running any command in the Debug Console because a small typo can cause permanent damage to the collection.

mw.col.db.execute("delete from revlog where cid not in (select id from cards)")
mw.col.set_schema_modified()

Maybe it’ll help a bit, I’ve added displaying size of the revlog table in Note Size addon (v2.10.0):

4 Likes

I have 80MB worth of Revlog

That is like 38% of my collection memory size. In comparison to yours (9% of collection size), it is significant.

1 Like

My collection size has risen back to 208 MB @vaibhav so I don’t know whats that about.
I havent added new cards today. Just reviewing. Is having 2538 reviews really the cause for an increase in 3MB :red_question_mark:
image

This is compressed size of the revlogs, but we want the uncompressed size.

According to my past observations with deleting revlogs, 100k revlogs have about 3 MB of compressed size and 13k revlogs have about 7 MB of uncompressed size.

But, the relationship doesn’t seem to be linear (or my 7 MB value might be slightly overestimated) because @DerIshmaelite’s revlog size would become more than 1 GB otherwise.

Sorry, it seems that I misinterpreted my past observations. The note size add-on seems to be correct.

I don’t think so. Maybe AnkiWeb takes some time to reflect changes in size? So, the your previous collection size may be slightly more than 205 MB?

But both the addon and Ankiweb registered a drop to 205MB…

Did you choose Upload on another device (like your phone)? This can cause the deleted revlogs to be restored to AnkiWeb.

No, I did not touch my phone. Just synced to AnkiWeb (uploading to Ankiweb) + Checked Database.

Coming back to this after 6 days have passed.

So this was my collection size, the last time I checked 5-6 days ago

This is my collection size now. It has grown 4 MB in size in about a week
image

In that time I have added 13 cloze notes containing a total of 1430 cloze cards. The rest of the cards I added in that time are Image Occlusion so I will not count them in.

Using the addon, I added the total note size memory up, the result is a total of 317 KB.

Making it an average of 24KB per note or 2.2 KB for every 10 cloze cards I make.

Now my note is text dense admittedly, I am making every cloze card as a basic card, but taking advantage of the ability of cloze cards of being in the same note for easy navigation of sibling cards.


Summary

Time span: 6 days
Notes added: 13
Cloze cards: 1430
Cloze cards per note: 110
Total memory used by notes: 317KB
Memory by one note on average: 24KB
Memory used by 10 cloze cards on average: 2.2 KB
Now in that time, my accumulated reviews are 35,704 Reviews.
Revlog size says that took 1 MB of memory.

So 1MB + 317KB (0.3MB) is 1.3 MB in total.

image
image

However Ankiweb says I have had an increase of 5 MB in this timespan! 1.3 MB do not definitely addup to 5MB so where does the rest of this memory consumption come from :red_question_mark: :red_question_mark: :red_question_mark:

It might be related to different file systems, which can report different file sizes for a variety of reasons. It’s probably best if you view the file sizes as something that is roughly accurate, not exactly accurate.

And how exactly do I do that? Both the addon and AnkiWeb report the same increase in overall collection size. But if I do the math using the file sizes of my notes and the revlog size increase, it does not add up.

I might have misunderstood. I thought you meant ankiweb and the addon on your computer report different file sizes – that could be because of different file systems being used.

I now understand what you mean – and unfortunately cannot explain this.

@Expertium @vaibhav Have you got any idea

It’s not just the text of the notes that takes space.

Every card needs to have a entry in the cards table, which stores info like whether it’s a new card or a learning card or review card, when it is due, what is its interval, etc.

In addition, there are indices that make operations on the database faster but take up space, which is proportional to the amount of data you have in your collection.

1 Like