mozilla

Revision 60907 of Performance

  • Revision slug: Storage/Performance
  • Revision title: Performance
  • Revision id: 60907
  • Created:
  • Creator: BrettWilson
  • Is current revision? No
  • Comment /* Queries */

Revision Content

Introduction

mozStorage uses sqlite as the database backend. It has generally good performance for a small embedded database. However, many things case various database operations to be slow.

Queries

Many times careful reordering of the SQL statement or creating the proper indices can give much better performance. See the sqlite optimizer overview on the sqlite web site for information on how sqlite uses indices and executes statements.

You might also want to try to the "explain" feature on your statements to see if they are using the indices you expect. First, download the command line tool from the sqlite download page. Be sure you have the same version command line tool (or newer) as what Mozilla is using. Currently (2006-04-10) Mozilla uses sqlite 3.3.4 but the latest precompiled version of the command line tools is not available. This will lead to errors that say "database is encrypted" because the tool is not able to recognise the file format. You may want to check the SQLITE_VERSION definition in {{template.Source("db/sqlite3/src/sqlite3.h")}}.

Caching

Disk writes

Revision Source

<h2 name="Introduction"> Introduction </h2>
<p>mozStorage uses sqlite as the database backend. It has generally good performance for a small embedded database. However, many things case various database operations to be slow.
</p>
<h2 name="Queries"> Queries </h2>
<p>Many times careful reordering of the SQL statement or creating the proper indices can give much better performance. See the <a class="external" href="http://www.sqlite.org/optoverview.html">sqlite optimizer overview</a> on the sqlite web site for information on how sqlite uses indices and executes statements.
</p><p>You might also want to try to the "explain" feature on your statements to see if they are using the indices you expect. First, download the command line tool from the <a class="external" href="http://www.sqlite.org/download.html">sqlite download page</a>. Be sure you have the same version command line tool (or newer) as what Mozilla is using. Currently (2006-04-10) Mozilla uses sqlite 3.3.4 but the latest precompiled version of the command line tools is not available. This will lead to errors that say "database is encrypted" because the tool is not able to recognise the file format. You may want to check the SQLITE_VERSION definition in {{template.Source("db/sqlite3/src/sqlite3.h")}}.
</p>
<h2 name="Caching"> Caching </h2>
<h2 name="Disk_writes"> Disk writes </h2>
Revert to this revision