Hacker News new | ask | show | jobs
by cryptonector 793 days ago
All browsers use SQLite3 DBs for this stuff. History is not "loaded into memory" -- it's in the SQLite3 DB, which has a page cache, so some of it might be in memory, but the amount of memory dedicated to the page cache is fixed, so you need not worry about it.

> I expect bookmarks to show up in search. Searching history is different, history has a ton of useless garbage in it.

There is truly no difference except that some URIs are bookmarked (and maybe also in recent history) and some are not. Either way searching these is just a SQL query against the SQLite3 DB. You really need not worry about the efficiency of the search -- it's fast enough. The table(s) that store these things have enough metadata to enable the kinds of searches you might want to do. Among such metadata is "this is a bookmark" and "this is not a bookmark".

> "Bookmark" means "When I type this, show this one URL before all the other ones that seem relevant".

That doesn't preclude treating it not that differently from history. You really need not worry about those details.

Also, a "bookmark" is more than that: it also has a name, it may be in a folder, it may be in the bookmark toolbar, it may have tags to help you search for it, etc.