Commit graph

10 commits

Author SHA1 Message Date
Damien Elmes
1d6dbf9900 rework tag handling and remove cardTags
The tags tables were initially added to speed up the loading of the browser by
speeding up two operations: gathering a list of all tags to show in the
dropdown box, and finding cards with a given tag. The former functionality is
provided by the tags table, and the latter functionality by the cardTags
table.

Selective study is handled by groups now, which perform better since they
don't require a join or subselect, and can be embedded in the index. So the
only remaining benefit of cardTags is for the browser.

Performance testing indicates that cardTags is not saving us a large amount.
It only takes us 30ms to search a 50k card table for matches with a hot cache.
On a cold cache it means the facts table has to be loaded into memory, which
roughly doubles the load time with the default settings (we need to load the
cards table too, as we're sorting the cards), but that startup time was
necessary with certain settings in the past too (sorting by fact created for
example). With groups implemented, the cost of maintaining a cache just for
initial browser load time is hard to justify.

Other changes:

- the tags table has any missing tags added to it when facts are added/edited.
  This means old tags will stick around even when no cards reference them, but
  is much cheaper than reference counting or a separate table, and simplifies
  updates and syncing.
- the tags table has a modified field now so we can can sync it instead of
  having to scan all facts coming across in a sync
- priority field removed
- we no longer put model names or card templates into the tags table. There
  were two reasons we did this in the past: so we could cram/selective study
  them, and for plugins. Selective study uses groups now, and plugins can
  check the model's name instead (and most already do). This also does away
  with the somewhat confusing behaviour of names also being tags.
- facts have their tags as _tags now. You can get a list with tags(), but
  editing operations should use add/deleteTags() instead of manually editing
  the string.
2011-04-28 09:23:29 +09:00
Damien Elmes
7ce661ac63 place cards with corrupt/missing facts into new fact instead of deleting 2010-12-13 06:46:20 +09:00
Damien Elmes
2d32e1aaa1 strip all chinese/japanese support out in favour of plugins 2009-06-10 22:58:28 +09:00
Damien Elmes
e807b35ce5 production->recall 2009-02-05 11:35:22 +09:00
Damien Elmes
e1c056f8fa allow blank answers by default by changing field props 2008-12-25 15:24:34 +09:00
Damien Elmes
af52a50547 backs are no longer unique by default 2008-12-11 01:13:35 +09:00
Damien Elmes
1d910be2cf remove hr tags from std models, balance is bad 2008-12-03 20:13:05 +09:00
Damien Elmes
21b59408cd refactor features to use hooks, update stdmodels, update findTags()
- remove description from fields, cards and models
- remove features and use field names instead
2008-12-03 19:22:15 +09:00
Damien Elmes
5ad662cf95 remove 'automatically generated by default' refs 2008-11-14 13:54:54 +09:00
Damien Elmes
5da3a0f5d3 initial commit from hg 2008-09-27 23:50:03 +09:00