Storage

From MozillaWiki
Revision as of 23:56, 11 March 2008 by MykMelez (talk | contribs) (add disk seek performance optimization as a proposed development priority)
Jump to navigation Jump to search

Storage is a SQLite database API. API documentation is available in the Mozilla Developer Center.

Proposed Future Development Priorities

Full Text Indexing

  • separation of indexing from storage
    • Firefox could use this to index visited web pages without having to store the contents of the pages themselves.
    • Thunderbird could use this to index email messages without having to store their contents in SQLite (ultimately it might make sense to store contents as well, but that's a larger, longer-term change).
    • Komodo could use this to index source code stored in files on disk.
  • built-in tokenization of Unicode text (i.e. without having to either compile in a large separate library or write custom functions);
  • tokenization of marked up text (HTML, PDF, etc.).

Performance

Dr. Hipp posted to the SQLite users list about a disk seek performance optimization that could be a boon to Places performance:

Creating an index on A,B is equivalent to sorting on A,B.

The sorting algorithm currently used by SQLite requires
O(NlogN) comparisons, which is optimial.  But it also requires
O(N) disk seeks, which is very suboptimal.  You don't notice
all these seeks if your database fits in cache.  But when you
get into databases of about 3GB, the seeking really slows you
down.

A project on our to-do list is to implement a new sorter
that uses O(1) seeks.  We know how to do this.  It is just
finding time to do the implementation.