Hacker News new | ask | show | jobs
by cryptonector 798 days ago
Relationally the only difference between a "tab", "history", and a "bookmark" is a column that tells you what kind it is.
2 comments

Kinda but not really.

I expect a tab to stay in memory, at least in virtual memory, and not need to hit the server if it's in the background for a while and then I click on it again, unlike history or bookmarks.

I expect history to not be loaded in memory, it would be a waste of memory.

I expect bookmarks to show up in search. Searching history is different, history has a ton of useless garbage in it. "Bookmark" means "When I type this, show this one URL before all the other ones that seem relevant".

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.

If they serve the same purpose, doesn't that open the possibility to use one of them for something else?

I'm also in the group that never keeps more than 10 tabs open, much fewer usually. The idea of having all my bookmarks displayed in a long sequence of tabs sounds horrific to me personally. It would just be an overwhelming amount of information.

I would love it if bookmarks and history were easier to search and retrieve. Having them displayed in a thousand tabs on my screen constantly not so much.

They don't have to be displayed in tabs.
Your response confuses me. The discussion in the thread includes comments about people keeping 1000 tabs, and other people saying that tabs, bookmarks and history are the same thing. I was responding that it doesn't feel very practical for my own usage. Can you explain what you mean in your response?
They are all just rows in a SQLite3 DB table. That allows you to search all of them -bookmarks, history, tabs- at once.